Traits class
In computer programming, a traits class is a class template template used to associate information or behaviour to a compile-time entity, typically a data type or a constant, without modifying the existing entity. In the C++ programming language, this is normally achieved by defining a primary class template, and creating explicit or partial specializations for the relevant types.
Usage
It is used in Standard Template Library and the C++ standard library to support generic container classes. The technique is used extensively in the Boost TypeTraits library.
External links
- Generic Programming Techniques from Boost
- iterator_traits<Iterator> from SGI
- Traits: a new and useful template technique, Nathan C. Myers, C++ Report, June 1995 issue
Stub icon | This computer programming-related article is a stub. You can help Wikipedia by expanding it. |
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...