Re: Default argument for templatized function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adrian Bentley <adruab@xxxxxxxxx> writes:

> Ok so here's my problem, I have this templatized class (with T).  And
> for it I'm defining a templatized member function (with F), I want the
> function to take a comparison operation as a member to make it more
> flexible.
> 
> I'm defining:
> 
> template < typename T >
> class myclass
> {
> public:
>         template < typename F >
>         bool valid(const F & func = std::less<T>()) const
[snip]

14.8.2.4/17:

    # A template type-parameter cannot be deduced from the type of a
    # function default argument.

It then continues with an example much like yours.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux