Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-06-07 16:23:43


Hi All,

BOOST_CLASS_REQUIRES is a bit broken, but instead of fixing it I'm
thinking of moving to the non-macro approach suggested by Bjarne:

http://www.research.att.com/~bs/bs_faq2.html#constraints

Here's how I envision the concept check working for a class:

#include <boost/concept_check.hpp>

namespace boost {
  template <class Concept>
  struct class_requires {
    class_requires() { function_requires<Concept>(); }
  };
} // namespace boost

namespace foo {
  template <class T>
  struct Vector
    : public boost::class_requires< boost::SGIAssignableConcept<T> >
  {
  };
}// namespace foo

struct bar {
  bar(int) { }
private:
  bar(const bar&) { }
};

int main()
{
  foo::Vector<bar> v;
  return 0;
}

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate, IU B'ton email: jsiek_at_[hidden]
 Summer Manager, AT&T Research phone: (973) 360-8185
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk