Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Re: DefaultConstructible concept satisfied by an incomplete class?

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2007-07-24 09:13:07


On Sun, 2007-07-01 at 23:23 +0200, nielsprogramming_at_[hidden] wrote:
> Is it possible to have a concept satisfied by an incomplete class???

Yes, but only if that concept's requirements can be satisfied without
having a definition of that class. For example:

  concept Fooable<typename T> {
    void foo(const T&);
  }

  struct X;
  void foo(const X&);

  concept_map Fooable<X> { } // okay!
  
DefaultConstructible, however, cannot be satisfied by an incomplete
class, because one needs to complete the class to see if it has a
default constructor.

  - Doug