[ConceptGCC] |
ConceptGCC :Re: does vector require CopyConstructible? |
From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2007-03-08 07:29:35
On Sun, 2007-03-04 at 15:34 -0700, Martin Sebor wrote:
> I expected to see a compilation error for the snippet below
> since struct S doesn't meet the CopyConstructible requirement
> of vector (23.1, p3). I looked to see if N2085 removes the
> requirement but if I'm reading the concept_map for vector
> in [lib.sequence.reqmts], p39, right, it's still there. So
> my question is: should I expect an error in the case or not,
> and if not, why?
>
> struct S { private: S (S&); };
> std::vector<S> v;
Yes, you should expect an error. However, the ConceptGCC Standard
Library doesn't yet have requires clauses for the containers, e.g., we
have the C++03
template<typename T, typename Alloc = std::allocator<T>>
class vector;
rather than the concepts version:
template<CopyConstructible T, Allocator Alloc = std::allocator<T>>
class vector;
Cheers,
Doug