Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calling default constructor by using uniform initialization. #340

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/Imath/ImathTypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ template <typename T, typename Base> struct has_xy
// Valid only if .x, .y exist and are the right type: return a Yes.
template <
typename C,
IMATH_ENABLE_IF (std::is_same<decltype (C ().x), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C ().y), Base>::value)>
IMATH_ENABLE_IF (std::is_same<decltype (C {}.x), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C {}.y), Base>::value)>
static Yes& test (int);

// Fallback, default to returning a No.
Expand All @@ -113,9 +113,9 @@ template <typename T, typename Base> struct has_xyz
// Valid only if .x, .y, .z exist and are the right type: return a Yes.
template <
typename C,
IMATH_ENABLE_IF (std::is_same<decltype (C ().x), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C ().y), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C ().z), Base>::value)>
IMATH_ENABLE_IF (std::is_same<decltype (C {}.x), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C {}.y), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C {}.z), Base>::value)>
static Yes& test (int);

// Fallback, default to returning a No.
Expand All @@ -142,10 +142,10 @@ template <typename T, typename Base> struct has_xyzw
// Valid only if .x, .y, .z, .w exist and are the right type: return a Yes.
template <
typename C,
IMATH_ENABLE_IF (std::is_same<decltype (C ().x), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C ().y), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C ().z), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C ().w), Base>::value)>
IMATH_ENABLE_IF (std::is_same<decltype (C {}.x), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C {}.y), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C {}.z), Base>::value),
IMATH_ENABLE_IF (std::is_same<decltype (C {}.w), Base>::value)>
static Yes& test (int);

// Fallback, default to returning a No.
Expand Down Expand Up @@ -173,7 +173,7 @@ template <typename T, typename Base, int Nelem> struct has_subscript
template <
typename C,
IMATH_ENABLE_IF (std::is_same<
typename std::decay<decltype (C ()[0])>::type,
typename std::decay<decltype (C {}[0])>::type,
Base>::value)>
static Yes& test (int);

Expand Down Expand Up @@ -208,7 +208,7 @@ struct has_double_subscript
template <
typename C,
IMATH_ENABLE_IF (std::is_same<
typename std::decay<decltype (C ()[0][0])>::type,
typename std::decay<decltype (C {}[0][0])>::type,
Base>::value)>
static Yes& test (int);

Expand Down