Spec-Zone.ru › C++

std::meta::is_volatile

Defined in header <meta>
consteval bool is_volatile( std::meta::info r );
(since C++26)

Let T be std::meta::type_of(r) if has-type(r) is true. Otherwise, let T be std::meta::dealias(r).

Returns: true if T represents a volatile (or const volatile) type, or a volatile-qualified function type. Otherwise, false.

Parameters

r - a reflection value

Return value

true if T represents a volatile type, or a volatile-qualified function type. Otherwise, false.

Example

#include <meta>

int a;
volatile int b;
static_assert(!is_volatile(^^a));
static_assert( is_volatile(^^b));

void foo();

struct S
{
    auto bar() const volatile noexcept -> void;
};
static_assert(!is_volatile(^^foo));
static_assert( is_volatile(^^S::bar));

int main() {}

See also

is_volatile
(C++11)
checks if a type is volatile-qualified
(class template)
add_cvadd_constadd_volatile
(C++26)(C++26)(C++26)
adds const and/or volatile qualifiers to reflected type
(function)
add_cvadd_constadd_volatile
(C++11)(C++11)(C++11)
adds const and/or volatile qualifiers to the given type
(class template)
remove_cvremove_constremove_volatile
(C++26)(C++26)(C++26)
removes const and/or volatile qualifiers from reflected type
(function)
remove_cvremove_constremove_volatile
(C++11)(C++11)(C++11)
removes const and/or volatile qualifiers from the given type
(class template)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_volatile

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API