Boost C++ Libraries: Ticket #933: Can't use BOOST_CLASS_REQUIRES macro https://svn.boost.org/trac10/ticket/933 <pre class="wiki">The BOOST_CLASS_REQUIRES macro does not work correctly when used outside of the boost namespace. For example, if I write template &lt;typename RandIter&gt; class foo { BOOST_CLASS_REQUIRES(RandIter, boost::RandomAccessIteratorConcept); ... }; I get a syntax error at the macro, because the implementation of the macro assumes that the second argument is an unqualified name. A possible, but not terribly satisfactory, workaround is to use a typedef; I would suggest that if you can't find a good way to fix this problem, you should document both the problem and its workaround. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/933 Trac 1.4.3 ksvanhorn Thu, 07 Jun 2001 20:37:06 GMT <link>https://svn.boost.org/trac10/ticket/933#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/933#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=239593 I just tried out the workaround, and it doesn't work -- the second argument needs to be a template, and C++ doesn't have template typedefs. So I know of no workaround at all for this problem. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>jsiek</dc:creator> <pubDate>Thu, 07 Jun 2001 20:40:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/933#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/933#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=32836 One option is to added a parameter to the macro for the namespace. I'm not all that crazy about that solution. Perhaps there's a better way... </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>jsiek</dc:creator> <pubDate>Thu, 07 Jun 2001 21:16:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/933#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/933#comment:3</guid> <description> <pre class="wiki">Logged In: YES user_id=32836 Here's an alternative to BOOST_CLASS_REQUIRES from Bjarne: http://www.research.att.com/~bs/bs_faq2.html#constraints // Here's how I'd adapt it into the boost concept checking library namespace boost { template &lt;class Concept&gt; struct class_requires { class_requires() { function_requires&lt;Concept&gt;(); } }; } // namespace boost namespace foo { template &lt;class T&gt; struct Vector : public boost::class_requires&lt; boost::SGIAssignableConcept&lt;T&gt; &gt; { }; }// namespace foo </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>jsiek</dc:creator> <pubDate>Wed, 19 Oct 2005 20:35:48 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/933#comment:4 https://svn.boost.org/trac10/ticket/933#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> Ticket