Ask your own question, for FREE!
Mathematics 19 Online
OpenStudy (anonymous):

please explain template metaprogramming to me.

OpenStudy (anonymous):

template< unsigned char byte > class BITS_SET { public: enum { B0 = (byte & 0x01) ? 1:0, B1 = (byte & 0x02) ? 1:0, B2 = (byte & 0x04) ? 1:0, B3 = (byte & 0x08) ? 1:0, B4 = (byte & 0x10) ? 1:0, B5 = (byte & 0x20) ? 1:0, B6 = (byte & 0x40) ? 1:0, B7 = (byte & 0x80) ? 1:0 }; public: enum{RESULT = B0+B1+B2+B3+B4+B5+B6+B7}; };

OpenStudy (anonymous):

lots of angle brackets... scary: template <blahblahblah> { }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!