This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.

2928. is_callable is not a good name

Section: 21.3.3 [meta.type.synop], 21.3.7 [meta.rel] Status: Resolved Submitter: United States Opened: 2017-02-03 Last modified: 2020-09-06

Priority: Not Prioritized

View other active issues in [meta.type.synop].

View all other issues in [meta.type.synop].

View all issues with Resolved status.

Discussion:

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.

[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 21.3.3 [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 21.3.7 [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 […]
    […]

[2017-02-24, Daniel comments]

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

[2017-03-12, post-Kona]

Resolved by p0604r0.

Proposed resolution: