Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <type_traits>
  2.  
  3. #include <boost/hana/type.hpp>
  4. #include <boost/hana/core/when.hpp>
  5. namespace hana = boost::hana;
  6.  
  7. struct S {
  8. template<
  9. typename T,
  10. typename = typename std::enable_if_t< (T::value) > > // <-- equivalent?
  11. S (const T&) { }
  12. };
  13.  
  14. struct X { static constexpr int value = 0; };
  15. struct Y { static constexpr int value = 1; };
  16.  
  17. int main () {
  18. S a (X { }); // <-- must fail
  19. S b (Y { });
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement