tuple initialisation from GenNode: disallow any numerical conversion from LUID

since this is a quick-n-dirty workariound, until we're using GCC-5,
I'll err for the simple and safe side and disallow any conversion
from LuidH do some algebraic data type. The problem arises,
sincd LuidH defines a conversion to size_t, which depends
on the platform. So, without checking the actual NumericLimits,
there is no way we can allow a conversion to size_t in a
hard wired way, while disallowing a narrowing conversion
to 32bit unsigned int on 64bit platforms.

And in the end, we don't want conversions from LUID to
numeric values to happen automatically anyway. But of
course we *do* want automatic promotion from a LuidH
to a PlacementRef...
This commit is contained in:
Fischlurch 2016-01-28 21:21:41 +01:00
parent 80ca498d79
commit 69d2a4148d

View file

@ -351,6 +351,13 @@ namespace meta {
>
{ };
template<typename TAR>
struct is_narrowingInit<lib::hash::LuidH, TAR>
: __or_<is_arithmetic<TAR>
,is_floating_point<TAR>
>
{ };
#define TRAIT_IS_NARROWING(_SRC_, _TAR_) \
template<> \
struct is_narrowingInit<_SRC_, _TAR_> \
@ -376,16 +383,6 @@ namespace meta {
TRAIT_IS_NARROWING (double, float)
TRAIT_IS_NARROWING (lib::hash::LuidH, int64_t)
TRAIT_IS_NARROWING (lib::hash::LuidH, int32_t)
TRAIT_IS_NARROWING (lib::hash::LuidH, int16_t)
TRAIT_IS_NARROWING (lib::hash::LuidH, int8_t)
TRAIT_IS_NARROWING (lib::hash::LuidH, char)
TRAIT_IS_NARROWING (lib::hash::LuidH, uint16_t)
TRAIT_IS_NARROWING (lib::hash::LuidH, uint8_t)
TRAIT_IS_NARROWING (lib::hash::LuidH, double)
TRAIT_IS_NARROWING (lib::hash::LuidH, float)
#undef TRAIT_IS_NARROWING