[ConceptGCC] |
ConceptGCC :Re: Splitting out implementations? |
From: Douglas Gregor (dgregor_at_[hidden])
Date: 2007-11-20 11:09:08
Ciaran McCreesh wrote:
> I'm fairly sure I'm missing something obvious here...
>
I think it's the compiler that is missing something obvious :)
> #include <concepts>
> #include <iterator>
>
> template <typename T_>
> requires std::ForwardIterator<T_>
> struct F
> {
> F();
> };
>
> template <typename T_>
> requires std::ForwardIterator<T_>
> F<T_>::F()
> {
> }
>
> gives:
>
> a.cc:14: error: invalid use of incomplete type âstruct F<T_>â
> a.cc:8: error: declaration of âstruct F<T_>â
> a.cc:14: error: template definition of non-template âF<T_>::F()â
> And
>
> template <typename T_>
> F<T_>::F()
> {
> }
>
> gives:
>
> a.cc:13: error: new declaration âF<T_>::F()â
> a.cc:9: error: ambiguates old declaration âF<T_>::F()â
>
> What's the correct way of splitting out the implementation?
>
The first one is the correct version.
- Doug