boostorg / core

Boost Core Utilities
133 stars 83 forks source link

adding boost::use_default to core #47

Closed HDembinski closed 5 years ago

HDembinski commented 5 years ago

Several libraries (iterators, histogram, range, gil, fusion) use a tag type called use_default. This is used as a generic default template parameter for types with several template parameters, e.g.

template <class T1 = use_default, class T2 = use_default, class T2 = use_default>
struct my_type {};

The type originates from the iterator library, and it defined there in the boost namespace, boost::use_default. It is independently defined at least in fusion and histogram, which also have a need for default parameters in long type lists. It could be used other libraries as well, like container.

I propose to move this type from iterators to core, because it is generically useful and also helps to unify interfaces of boost libraries.

glenfe commented 5 years ago

See 4ea704e in Core and https://github.com/boostorg/iterator/pull/49 in Iterator (waiting on Travis and Appveyor to complete).

HDembinski commented 5 years ago

thank you!