0

I have a class:

template<typename T, typename S>
class filterable_data
{
    /* ... */
};

I create those two instances:

filterable_data<int, char> a;
filterable_data<int, bool> b = a;

My question is, how can I write that constructor properly?

1
  • What did you try and where did you actually fail? Commented Jul 9, 2014 at 10:45

1 Answer 1

3

By making it a template too:

template<typename T2, typename S2>
filterable_data(const filterable_data<T2, S2>& other);
Sign up to request clarification or add additional context in comments.

1 Comment

It is useful and probably what the OP wants, but it's not a copy constructor. A copy constructor is never a template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.