Title
is_callable is not a good name
Status
resolved
Section
[meta.type.synop][meta.rel]
Submitter
United States

Created on 2017-02-03.00:00:00 last changed 94 months ago

Messages

Date: 2017-03-15.00:00:00

[ 2017-03-12, post-Kona ]

Resolved by p0604r0.

Date: 2017-02-15.00:00:00

[ 2017-02-24, Daniel comments ]

I suggest to apply the paper d0604r0 instead, available on the Kona LWG wiki.

Date: 2017-02-15.00:00:00

[ 2017-02-22, Daniel comments and provides concrete wording ]

I'm strongly in favour for this change to possibly allow for a future "pure" is_callable trait that solely describes function call-like expressions.

Previous resolution [SUPERSEDED]:

This wording is relative to N4640.

  1. Modify [meta.type.synop], header <type_traits> synopsis, as indicated:

    […]
    // 20.15.6, type relations
    […]
    
    template <class, class R = void> struct is_invocablecallable; // not defined
    template <class Fn, class... ArgTypes, class R>
    struct is_invocablecallable<Fn(ArgTypes...), R>;
    
    template <class, class R = void> struct is_nothrow_invocablecallable; // not defined
    template <class Fn, class... ArgTypes, class R>
    struct is_nothrow_invocablecallable<Fn(ArgTypes...), R>;
    
    […]
    
    // 20.15.6, type relations
    […]
    template <class T, class R = void> constexpr bool is_invocablecallable_v
    = is_invocablecallable<T, R>::value;
    template <class T, class R = void> constexpr bool is_nothrow_invocablecallable_v
    = is_nothrow_invocablecallable<T, R>::value;
    […]
    
  2. Modify [meta.rel], Table 44 — "Type relationship predicates", as indicated:

    Table 44 — Type relationship predicates
    […]
    template <class Fn, class...
    ArgTypes, class R>
    struct is_invocablecallable<
    Fn(ArgTypes...), R>;
    […] […]
    template <class Fn, class...
    ArgTypes, class R>
    struct is_nothrow_invocablecallable<
    Fn(ArgTypes...), R>;
    is_invocablecallable_v<
    Fn(ArgTypes...), R>
    is
    true […]
    […]
Date: 2017-02-03.00:00:00
Addresses US 86

is_callable is not a good name because it implies F(A...) instead of INVOKE(F, A...)

Proposed change: Rename is_callable to is_invocable and rename is_nothrow_callable to is_nothrow_invocable.

History
Date User Action Args
2017-03-12 23:04:12adminsetstatus: new -> resolved
2017-02-24 21:23:01adminsetmessages: + msg8998
2017-02-22 19:31:24adminsetmessages: + msg8979
2017-02-22 19:31:24adminsetmessages: + msg8978
2017-02-03 00:00:00admincreate