![]() |
staticlib_support
1.2.1
|
Namespaces | |
| namespace | detail_defer |
| namespace | logic |
Classes | |
| class | exception |
| Base exception class for various exceptions in staticlib modules. More... | |
| class | bad_observed_pointer_access_exception |
| Observer-specific exception. More... | |
| class | observer_ptr |
| Non-owning pointer. More... | |
| class | bad_optional_access_exception |
| Optional-specific exception. More... | |
| class | optional |
| Basic implementation of optional, reference impl ( https://github.com/akrzemi1/Optional ) cannot be used, as it doesn't support MSVC2013. More... | |
| class | release_deleter |
Deleter implementation for std::shared_ptr that allows to release the owned object from shared_ptr More... | |
Functions | |
| template<typename T > | |
| detail_defer::defer_guard< T > | defer (T func) |
| Creates a "guard object", that will execute specified lambda function on destruction. | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_int32 (T val) |
Checks that specified unsigned integer lies between <int32_t>::min() and <int32_t>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_uint32 (T val) |
Checks that specified unsigned integer lies between 0 (inclusive) and <uint32_t>::max() | |
| template<typename T > | |
| bool | is_uint32_positive (T val) |
Checks that specified integer lies between 0 (exclusive) and <uint32_t>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_int16 (T val) |
Checks that specified unsigned integer lies between <int16_t>::min() and <int16_t>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_uint16 (T val) |
Checks that specified unsigned integer lies between 0 (inclusive) and <uint16_t>::max() | |
| template<typename T > | |
| bool | is_uint16_positive (T val) |
Checks that specified integer lies between 0 (exclusive) and <uint16_t>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_int64 (T val) |
Checks that specified unsigned integer lies between <int64_t>::min() and <int64_t>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_uint64 (T val) |
Checks that specified unsigned integer lies between 0 (inclusive) and <uint64_t>::max() | |
| template<typename T > | |
| bool | is_uint64_positive (T val) |
Checks that specified integer lies between 0 (exclusive) and <uint64_t>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_streamsize (T val) |
Checks that specified unsigned integer lies between <streamsize>::min() and <streamsize>::max() | |
| template<typename T > | |
| std::enable_if < std::is_unsigned< T >::value, bool >::type | is_sizet (T val) |
Checks that specified unsigned integer lies between 0 (inclusive) and <size_t>::max() | |
| template<typename T > | |
| bool | is_sizet_positive (T val) |
Checks that specified integer lies between 0 (exclusive) and <uint32_t>::max() | |
| template<typename T , typename... Args> | |
| std::unique_ptr< T > | make_unique (Args &&...args) |
Shortcut template for creating std::unique_ptr, see details. | |
| template<typename T > | |
| observer_ptr< T > | make_observer_ptr (T *target) |
| Helper function, constructs new observer instance. | |
| template<typename T > | |
| observer_ptr< T > | make_observer_ptr (T &target) |
| Helper function, constructs new observer instance. | |
| template<typename T > | |
| optional< T > | make_optional (T &&value) |
| Helper function, constructs optional instance. | |
| template<typename T > | |
| std::shared_ptr< T > | make_shared_with_release_deleter (T *ptr) |
| template<typename T > | |
| std::unique_ptr< T > | make_unique_from_shared_with_release_deleter (std::shared_ptr< T > ptr) |
| template<typename T > | |
| std::string | to_string_any (const T &obj) |
Generic to_string implementation. | |
| template<typename T > | |
| std::string | to_string (const T &obj) |
Generic to_string implementation, already exists as std::to_string in most C++11 compilers except GCC 4.8 on Android. | |
| std::string | to_string_bool (bool val) |
| Converts bool value to "true" or "false" string. | |
| detail_defer::defer_guard<T> staticlib::support::defer | ( | T | func | ) |
Creates a "guard object", that will execute specified lambda function on destruction.
Similar in nature with GSL's finally.
| func | lambda function to execute on destruction, must be "noexcept" |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_int16 | ( | T | val | ) |
Checks that specified unsigned integer lies between <int16_t>::min() and <int16_t>::max()
Checks that specified signed integer lies between <int16_t>::min() and <int16_t>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_int32 | ( | T | val | ) |
Checks that specified unsigned integer lies between <int32_t>::min() and <int32_t>::max()
Checks that specified signed integer lies between <int32_t>::min() and <int32_t>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_int64 | ( | T | val | ) |
Checks that specified unsigned integer lies between <int64_t>::min() and <int64_t>::max()
Checks that specified signed integer lies between <int64_t>::min() and <int64_t>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_sizet | ( | T | val | ) |
Checks that specified unsigned integer lies between 0 (inclusive) and <size_t>::max()
Checks that specified signed integer lies between 0 (inclusive) and <size_t>::max()
| val | integer |
| bool staticlib::support::is_sizet_positive | ( | T | val | ) |
Checks that specified integer lies between 0 (exclusive) and <uint32_t>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_streamsize | ( | T | val | ) |
Checks that specified unsigned integer lies between <streamsize>::min() and <streamsize>::max()
Checks that specified signed integer lies between <streamsize>::min() and <streamsize>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_uint16 | ( | T | val | ) |
Checks that specified unsigned integer lies between 0 (inclusive) and <uint16_t>::max()
Checks that specified signed integer lies between 0 (inclusive) and <uint16_t>::max()
| val | integer |
| bool staticlib::support::is_uint16_positive | ( | T | val | ) |
Checks that specified integer lies between 0 (exclusive) and <uint16_t>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_uint32 | ( | T | val | ) |
Checks that specified unsigned integer lies between 0 (inclusive) and <uint32_t>::max()
Checks that specified signed integer lies between 0 (inclusive) and <uint32_t>::max()
| val | integer |
| bool staticlib::support::is_uint32_positive | ( | T | val | ) |
Checks that specified integer lies between 0 (exclusive) and <uint32_t>::max()
| val | integer |
| std::enable_if<!std::is_unsigned< T >::value, bool >::type staticlib::support::is_uint64 | ( | T | val | ) |
Checks that specified unsigned integer lies between 0 (inclusive) and <uint64_t>::max()
Checks that specified signed integer lies between 0 (inclusive) and <uint64_t>::max()
| val | integer |
| bool staticlib::support::is_uint64_positive | ( | T | val | ) |
Checks that specified integer lies between 0 (exclusive) and <uint64_t>::max()
| val | integer |
| observer_ptr<T> staticlib::support::make_observer_ptr | ( | T * | target | ) |
Helper function, constructs new observer instance.
| target | target pointer |
| observer_ptr<T> staticlib::support::make_observer_ptr | ( | T & | target | ) |
Helper function, constructs new observer instance.
| target | target reference |
| optional<T> staticlib::support::make_optional | ( | T && | value | ) |
Helper function, constructs optional instance.
| value | value to store |
| std::shared_ptr<T> staticlib::support::make_shared_with_release_deleter | ( | T * | ptr | ) |
| std::unique_ptr<T> staticlib::support::make_unique | ( | Args &&... | args | ) |
Shortcut template for creating std::unique_ptr, see details.
Becomes obsolete with C++14.
| args | pointer object constructor arguments |
| std::unique_ptr<T> staticlib::support::make_unique_from_shared_with_release_deleter | ( | std::shared_ptr< T > | ptr | ) |
| std::string staticlib::support::to_string | ( | const T & | obj | ) |
Generic to_string implementation, already exists as std::to_string in most C++11 compilers except GCC 4.8 on Android.
| obj | object to stringify |
| std::string staticlib::support::to_string_any | ( | const T & | obj | ) |
Generic to_string implementation.
| obj | object to stringify |
|
inline |
Converts bool value to "true" or "false" string.
| val | boolean value |
1.8.1.2