J
Joseph Turian
How can I specialize the value of only one template parameter?
Here's the fragment of code I'd like to get working:
typedef enum {START, PARENT, CHILD, END} locator_ty;
template <locator_ty L, bool Signed>
class foo {
string str();
...
};
template <bool Signed> string foo<START, Signed>::str() const { return
"start"; }
template <bool Signed> string foo<END, Signed>::str() const { return
"end"; }
template <bool Signed> string foo<PARENT, Signed>::str() const { return
"parent"; }
template <bool Signed> string foo<CHILD, Signed>::str() const { return
"child"; }
Except the last four lines aren't syntactically correct.
Can anyone tell me the correct syntax?
Thanks!
Joseph
Here's the fragment of code I'd like to get working:
typedef enum {START, PARENT, CHILD, END} locator_ty;
template <locator_ty L, bool Signed>
class foo {
string str();
...
};
template <bool Signed> string foo<START, Signed>::str() const { return
"start"; }
template <bool Signed> string foo<END, Signed>::str() const { return
"end"; }
template <bool Signed> string foo<PARENT, Signed>::str() const { return
"parent"; }
template <bool Signed> string foo<CHILD, Signed>::str() const { return
"child"; }
Except the last four lines aren't syntactically correct.
Can anyone tell me the correct syntax?
Thanks!
Joseph