Boost logo

Boost :

Subject: [boost] [function_types] Number of default parameters
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-02-08 20:38:20


Hello all,

Is there a way to determine at compile-time the number of parameters
with default values from a function type?

For example, can I program the following `count_defaults` metafunction?

    count_defaults< bool(*)(int x, int y) >::value // == 0
    count_defaults< bool(*)(int x, int y = 1 >::value // == 1
    count_defaults< bool(*)(int x = 2, int y =1) >::value // == 2

(If this is possible, it could be added to Boost.FunctionTypes.)

Thank you.

-- 
Lorenzo

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk