Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Splitting out implementations?

From: Ciaran McCreesh (ciaran.mccreesh_at_[hidden])
Date: 2007-11-02 08:46:12


I'm fairly sure I'm missing something obvious here...

#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?

Thanks,

-- 
Ciaran McCreesh