|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
Other general-purpose utilities.
Classes | |
| struct | triqs::utility::dressed_iterator< IteratorType, Dressing, DressingAuxiliaryArgumentPtrType > |
| STL-compatible iterator that wraps an underlying iterator and dereferences to a user-supplied dressing type. More... | |
| struct | triqs::utility::dressed_iterator< IteratorType, Dressing, void > |
| Specialization of triqs::utility::dressed_iterator for the case where no auxiliary pointer is needed. More... | |
| class | triqs::utility::scope_guard< F > |
| RAII wrapper that invokes a callable when it goes out of scope, unless dismissed. More... | |
Typedefs | |
| using | dcomplex = std::complex<double> |
| Convenience alias for std::complex<double>. | |
Functions | |
| std::string | triqs::utility::demangle (const char *name) |
| Demangle a mangled C++ symbol name to a human-readable string. | |
| std::string | triqs::utility::demangle (std::string const &name) |
| Overload of demangle accepting an std::string. | |
| template<class F> | |
| scope_guard< F > | triqs::utility::exec_at_scope_exit (F f) |
| Build a scope_guard from a callable. | |
| template<typename T, typename... U> | |
| T | triqs::utility::factory (U &&...x) |
| Generic factory to construct an object of a given type from an arbitrary parameter pack of arguments. | |
| std::string | triqs::utility::get_name (std::type_info const &info) |
| Demangle the name corresponding to an std::type_info. | |
| template<int NArgs, typename Lambda, typename T> | |
| decltype(auto) | triqs::utility::make_lazy_bracket (Lambda &&f, T const &x) |
| Invoke a callable lazily by accumulating arguments through chained operator[] calls. | |
| template<class F> | |
| scope_guard< F > | triqs::utility::make_scope_guard (F f) |
| Build a scope_guard from a callable. | |
| template<typename T> | |
| std::string | triqs::utility::typeid_name () |
| Human-readable name of a given static type. | |
| template<typename T> | |
| std::string | triqs::utility::typeid_name (T const &obj) |
| Human-readable name of the dynamic type of a given object. | |
| std::string triqs::utility::demangle | ( | const char * | name | ) |
#include <triqs/utility/typeid_name.cpp>
Demangle a mangled C++ symbol name to a human-readable string.
| name | Mangled name (typically typeid(...).name()). |
Definition at line 35 of file typeid_name.cpp.
| scope_guard< F > triqs::utility::exec_at_scope_exit | ( | F | f | ) |
#include <triqs/utility/scope_guard.hpp>
Build a scope_guard from a callable.
The returned object must be bound to a named variable.
| F | Callable type. |
| f | Callable to run at scope exit. |
Definition at line 112 of file scope_guard.hpp.
| T triqs::utility::factory | ( | U &&... | x | ) |
#include <triqs/utility/factory.hpp>
Generic factory to construct an object of a given type from an arbitrary parameter pack of arguments.
The actual construction is delegated to the helper class detail::factories<T>, whose static invoke member is called with the forwarded arguments. By default detail::factories<T> simply forwards its single argument to a constructor of T, so any type that is directly constructible from the given argumnets works out of the box.
To support custom construction logic for a type T (e.g. element-wise conversion, allocation, or building from a different representation), provide a partial or full specialization of detail::factories<T> exposing one or more static invoke overloads that return a T. The library already specializes it for std::vector<T> to allow constructing a vector from another vector with element-wise conversion.
| T | Target type. |
| U | Argument types. |
| x | Constructor arguments. |
Definition at line 95 of file factory.hpp.
| std::string triqs::utility::get_name | ( | std::type_info const & | info | ) |
#include <triqs/utility/typeid_name.cpp>
Demangle the name corresponding to an std::type_info.
| info | Type info object. |
Definition at line 57 of file typeid_name.cpp.
| decltype(auto) triqs::utility::make_lazy_bracket | ( | Lambda && | f, |
| T const & | x ) |
#include <triqs/utility/lazy_bracket.hpp>
Invoke a callable lazily by accumulating arguments through chained operator[] calls.
| NArgs | Total number of expected arguments. |
| Lambda | Callable type. |
| T | Type of the first argument. |
| f | Callable to invoke once all indices are collected. |
| x | First argument. |
Definition at line 82 of file lazy_bracket.hpp.
| scope_guard< F > triqs::utility::make_scope_guard | ( | F | f | ) |
#include <triqs/utility/scope_guard.hpp>
Build a scope_guard from a callable.
The returned object must be bound to a named variable.
| F | Callable type. |
| f | Callable to run at scope exit. |
Definition at line 123 of file scope_guard.hpp.
| std::string triqs::utility::typeid_name | ( | ) |
#include <triqs/utility/typeid_name.hpp>
Human-readable name of a given static type.
| T | Type of interest. |
Definition at line 71 of file typeid_name.hpp.
| std::string triqs::utility::typeid_name | ( | T const & | obj | ) |
#include <triqs/utility/typeid_name.hpp>
Human-readable name of the dynamic type of a given object.
| T | Type of the object. |
| obj | Object whose type name is requested. |
Definition at line 63 of file typeid_name.hpp.