Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-09-19 15:27:56

On Wed, 19 Sep 2001, Eric Ford wrote:
eford> Is there a way to have a custom concept checking class check that a
eford> class have a member function that has been templatized to take an
eford> arbitrary type?

Yes, you create a separate concept checking class just for that member
function. For example:

template <class Sequence, class Iter>
struct SequenceInsertConcept
  void constraints() const {
    s.insert(first, last);
  Sequence s;
  Iter first, last;

In the context of where you are applying the concept check, you will know
what the iterator type is, and will be able to pass it into the check.

function_requires< SequenceInsertConcept<MyContainer, SomeIter> >();


P.S. I'll have to add the above concept checking class to the BCCL...

 Jeremy Siek
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster ( office phone: (812) 855-9761

Boost list run by bdawes at, gregod at, cpdaniel at, john at