Go Down

Topic: My contribution to the Arduino community (Read 457 times) previous topic - next topic


Then make that a template also. The most basic way would be like this:

Code: [Select]
template< unsigned N >
  void CString::operator +=(const CString<N> &str){


How does it work if.....hypothetically.....CString was itself  template class.

Because then there will already be a 'template< unsigned N >' association with the implementation of the function.

Code: [Select]
template< unsigned N >
  void CString::operator +=(const CString<T> &str){

Not much use if you can only use the += operator on strings that are the same size.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131