std::meta::has_c_language_linkage
Defined in header <meta> | ||
|---|---|---|
consteval bool has_c_language_linkage( std::meta::info r ); | (since C++26) |
Determines if r represents a variable, function, or function type with "C" language linkage (extern "C"). Returns true if it does, false otherwise.
Parameters
| r | - | a reflection value |
Return value
true if what r represents has "C" language linkage, false otherwise.
Notes
If r does not represent a variable, function, or function type (e.g., if r represents a function template), the result is false.
Example
#include <meta>
extern "C" void foo();
static_assert(std::meta::has_c_language_linkage(^^foo) == true);
void moo();
static_assert(std::meta::has_c_language_linkage(^^moo) == false);
template<typename T>
T boo();
static_assert(std::meta::has_c_language_linkage(^^boo) == false);
int main() {}
See also
|
(C++26)(C++26)(C++26)(C++26) | checks if the reflected entity has a linkage (function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/has_c_language_linkage