Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

dawagner
Copy link
Contributor

Template resolution is tied to name mangling. Since we can't know for sure
which builtin type is used for each of int64_t, uint32_t, etc. we can't rely on
these typedefs. Builtin types, however, are reliable.

As an exemple: on some ABIs, size_t can be a long long but uint64_t a mere
long which means that for this particular platform, a call with a size_t
argument will not match a template instantiation with a uint64_t.

Signed-off-by: David Wagner david.wagner@intel.com

@@            master    #354   diff @@
======================================
Files          210     210
Stmts         7179    7179
Branches         0       0
Methods          0       0
======================================
Hit           5767    5767
Partial          0       0
Missed        1412    1412

Review entire Coverage Diff as of 5e23c39

Powered by Codecov. Updated on successful CI builds.

   

@dawagner dawagner force-pushed the darwin-size_t-template-instance branch from 4c4258f to a143c75 Compare February 24, 2016 08:43
@codecov-io
Copy link

Current coverage is 80.33%

Merging #354 into master will not affect coverage as of 4e4f280

@@            master    #354   diff @@
======================================
  Files          210     210       
  Stmts         7179    7179       
  Branches         0       0       
  Methods          0       0       
======================================
  Hit           5767    5767       
  Partial          0       0       
  Missed        1412    1412       

Review entire Coverage Diff as of 4e4f280

Powered by Codecov. Updated on successful CI builds.

@dawagner
Copy link
Contributor Author

@tcahuzax @krocard @cc6565 please review.

inline bool convertTo<uint8_t>(const std::string &str, uint8_t &result)
inline bool convertTo<unsigned char>(const std::string &str, unsigned char &result)
{
return details::convertToVia<uint8_t, uint32_t>(str, result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using unsigned char instead of uint8_t to convert it.

@dawagner dawagner force-pushed the darwin-size_t-template-instance branch 2 times, most recently from 80ab5f4 to 38ff857 Compare February 24, 2016 13:13
@tcahuzax
Copy link
Contributor

👍

Template resolution is tied to name mangling. Since we can't know for sure
which builtin type is used for each of int64_t, uint32_t, etc. we can't rely on
these typedefs. Builtin types, however, are reliable.

As an exemple: on some ABIs, size_t can be a long long but uint64_t a mere
long which means that for this particular platform, a call with a size_t
argument will not match a template instantiation with a uint64_t.

Signed-off-by: David Wagner <david.wagner@intel.com>
@krocard
Copy link
Contributor

krocard commented Feb 24, 2016

:shipit:

dawagner added a commit that referenced this pull request Feb 24, 2016
Integer template specializations: use builtin types instead of stdint
@dawagner dawagner merged commit e73e2f0 into intel:master Feb 24, 2016
@dawagner dawagner deleted the darwin-size_t-template-instance branch February 24, 2016 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants