If you want to add only one question, you can combine inheritance with specialization:
template <typename T> class reflected_base { // your current 'reflected' contents go here }; template <typename T> class reflected : public reflected_base { }; template <> class reflected<bool> : public reflected_base { vector<ar_index> which(); };
The disadvantage of this approach is that for each specialization you need to redefine certain operations (destructors, copy constructors, etc.). Another variant:
template <typename T> class specialized_reflected { }; template <> class specialized_reflected<bool> { public: vector<ar_index> which(); }; template <typename T> class reflected : public specialized_reflected<T> {
Although, there are potential problems with the dependent name. The third option (and probably the one I would choose) would be to use a non-member function:
vector<ar_index> which(reflected<bool>&);
source share