Re: [boost] accumulators::histogram

I have looked another time to the implementation of the histogram. If we want to implement it in the same class density, than it is needed to provide default parameter for density_cache_size or min/max. Is it possible to ensure that either density_cache_size or min/max is provided as parameter? Sorry for the question but I'm not so familiar with parameters... Best regards Hansjörg _______________________________________________________________________ Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220

Hansi Hansi wrote:
I have looked another time to the implementation of the histogram. If we want to implement it in the same class density, than it is needed to provide default parameter for density_cache_size or min/max. Is it possible to ensure that either density_cache_size or min/max is provided as parameter? Sorry for the question but I'm not so familiar with parameters...
Yes, it's possible. IIRC, a parameter pack is a valid MPL sequence, so you can us MPL algorithms to detect the presence or absence of any parameter. -- Eric Niebler Boost Consulting www.boost-consulting.com

on Fri Feb 01 2008, Eric Niebler <eric-AT-boost-consulting.com> wrote:
Hansi Hansi wrote:
I have looked another time to the implementation of the histogram. If we want to implement it in the same class density, than it is needed to provide default parameter for density_cache_size or min/max. Is it possible to ensure that either density_cache_size or min/max is provided as parameter? Sorry for the question but I'm not so familiar with parameters...
Yes, it's possible. IIRC, a parameter pack is a valid MPL sequence, so you can us MPL algorithms to detect the presence or absence of any parameter.
boost::parameter::binding< argpack, tag::parametername, void >::type will tell you. If the result is void, the parameter wasn't supplied. -- Dave Abrahams Boost Consulting http://boost-consulting.com

I have looked now at this but I don't understand how to solve this problem. maybe one can give me some example...then I will finish the histogram. Best regards Hansjörg David Abrahams schrieb:
on Fri Feb 01 2008, Eric Niebler <eric-AT-boost-consulting.com> wrote:
Hansi Hansi wrote:
I have looked another time to the implementation of the histogram. If we want to implement it in the same class density, than it is needed to provide default parameter for density_cache_size or min/max. Is it possible to ensure that either density_cache_size or min/max is provided as parameter? Sorry for the question but I'm not so familiar with parameters...
Yes, it's possible. IIRC, a parameter pack is a valid MPL sequence, so you can us MPL algorithms to detect the presence or absence of any parameter.
boost::parameter::binding< argpack, tag::parametername, void >::type
will tell you. If the result is void, the parameter wasn't supplied.

on Sat Feb 02 2008, Hansi <hansipet-AT-web.de> wrote:
I have looked now at this but I don't understand how to solve this problem. maybe one can give me some example...then I will finish the histogram.
Best regards Hansjörg
David Abrahams schrieb:
on Fri Feb 01 2008, Eric Niebler <eric-AT-boost-consulting.com> wrote:
Hansi Hansi wrote:
I have looked another time to the implementation of the histogram. If we want to implement it in the same class density, than it is needed to provide default parameter for density_cache_size or min/max. Is it possible to ensure that either density_cache_size or min/max is provided as parameter? Sorry for the question but I'm not so familiar with parameters...
Yes, it's possible. IIRC, a parameter pack is a valid MPL sequence, so you can us MPL algorithms to detect the presence or absence of any parameter.
boost::parameter::binding< argpack, tag::parametername, void >::type
will tell you. If the result is void, the parameter wasn't supplied.
argpack is the type of the argument pack. is_same< boost::parameter::binding< argpack, tag::parametername, void >::type, void >::value is a compile-time constant that is false iff the parameter named parametername is present in an argument pack of type argpack. -- Dave Abrahams Boost Consulting http://boost-consulting.com
participants (4)
-
David Abrahams
-
Eric Niebler
-
Hansi
-
Hansi Hansi