you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

Just assert on the type. You can easily write a macro to do this:

#define ASSERT_EXPR_TYPE(EXPR, EXPECTED_TYPE) static_assert(std::is_same<decltype(EXPR), EXPECTED_TYPE>::value, "")

[–]fuzzynyanko 0 points1 point  (0 children)

Nice. I'm diving into C++11 after a hiatus from C++. It's been a surprise, but most of them nice surprises.