Get base type of a template type (remove const/reference/etc.)

后端 未结 3 1517
天涯浪人
天涯浪人 2021-02-19 09:45

Is there a type traits template which returns the base type of a given type. By base type I mean the type with all value modifiers, const, volatile, etc. strip

3条回答
  •  有刺的猬
    2021-02-19 10:15

    try std::decay. It mimicks what happens when you pass arguments to functions by value: strips top-level cv-qualifiers, references, converts arrays to pointers and functions to function pointers.

    Regards, &rzej

提交回复
热议问题