userver: compiler Namespace Reference
Loading...
Searching...
No Matches
compiler Namespace Reference

Detailed Description

Compiler and C++ language related tweaks.

Classes

class  SelectValue
 Selects the proper value for the current compiler and standard library. More...
 
class  ThreadLocal
 Creates a unique thread-local variable that can be used in a coroutine-safe manner. More...
 
class  ThreadLocalScope
 The scope that grants access to a thread-local variable. More...
 

Typedefs

using SelectSize = SelectValue<std::size_t>
 Alias for std::size_t values selection for the current compiler and standard library.
 

Functions

std::string GetTypeName (std::type_index type)
 Returns a human-readable representation of provided type name.
 
template<typename T >
std::string GetTypeName ()
 Returns a human-readable representation of provided type name.
 
template<typename Factory >
 ThreadLocal (Factory factory) -> ThreadLocal< std::invoke_result_t< const Factory & >, Factory >
 

Typedef Documentation

◆ SelectSize

using compiler::SelectSize = SelectValue<std::size_t>

Alias for std::size_t values selection for the current compiler and standard library.

Definition at line 95 of file select.hpp.

Function Documentation

◆ GetTypeName()

template<typename T >
std::string compiler::GetTypeName ( )

Returns a human-readable representation of provided type name.

GetTypeName(typeidT)) outputs the type, not the alias. For std::chrono functions it gives unreadable results: std::chrono::duration<long, std::ratio<1l, 1l> > - it's seconds

The GetTypeName<T>() provides a more readable output.

Definition at line 81 of file demangle.hpp.