boost concept creation
Can someone give me a high level explanation of the idea behind how concepts work? I'm trying to write a new concept class which enforces that two types are the same and it's not quite clicking. Strangely gcc has this concept built in, so I was surprised that boost didn't. I noticed a boost::is_same<> template, but it's not a concept, so it's not usable inside a BOOST_CONCEPT_ASSERT() macro.
AMDG Zach wrote:
Can someone give me a high level explanation of the idea behind how concepts work? I'm trying to write a new concept class which enforces that two types are the same and it's not quite clicking. Strangely gcc has this concept built in, so I was surprised that boost didn't. I noticed a boost::is_same<> template, but it's not a concept, so it's not usable inside a BOOST_CONCEPT_ASSERT() macro.
For is_same and other boolean metafunctions you can use an assertion, which will give a better error message anyway: BOOST_MPL_ASSERT((boost::is_same<T1, T2>)); In Christ, Steven Watanabe
participants (2)
-
Steven Watanabe
-
Zach