By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,657 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,657 IT Pros & Developers. It's quick & easy.

template syntax...

P: n/a
Hi all,

I just hit the following definition in a c++ API:

template <class Str> template <class T, class B>
mysql_ColData<Str>::operator Null<T,B> () const {
if ((*this)[0] == 'N' && (*this)[1] == 'U' &&
(*this)[2] == 'U' && (*this)[3] == 'L' && (*this).size() == 4)
return Null<T,B>(null);
else return Null<T,B>(conv(T()));
}

Is the first line equivalent to
template <class Str, class T, class B> ?

Are both syntax compliant to c++ standards?

cheers

regard

phf
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
us**@domain.invalid wrote:
I just hit the following definition in a c++ API:

template <class Str> template <class T, class B>
mysql_ColData<Str>::operator Null<T,B> () const {
if ((*this)[0] == 'N' && (*this)[1] == 'U' &&
(*this)[2] == 'U' && (*this)[3] == 'L' && (*this).size() == 4)
return Null<T,B>(null);
else return Null<T,B>(conv(T()));
}

Is the first line equivalent to
template <class Str, class T, class B> ?
No, most certainly not.
Are both syntax compliant to c++ standards?


What do you mean by "both"? It very much depends on your declaration of
'mysql_ColData' and its member 'operator Null'. I mean, if you just ask
whether it's OK (call it compliant, standard, valid, legal, or whatever)
to write

template <class Str, class T, class B>

then how can anybody tell you if you don't supply the context?

V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.