![]() |
Utilities
Utilities header only library
|
Contains common lambda functions. More...
Variables | |
| const auto | GetId = [](const auto &obj) { return obj.GetId(); } |
| Lambda function that uses 'GetId' function to get object's id. More... | |
| const auto | GetPtrId = [](const auto &obj) { return obj->GetId(); } |
| Lambda function that uses 'GetId' function to get object's id. More... | |
| const auto | OptValue = [](const auto &obj) { return obj.value(); } |
| Lambda function that gets std::optional's value. More... | |
| const auto | OptHasValue = [](const auto &obj) { return obj.has_value(); } |
| Lambda function that returns whether a std::optional has value. More... | |
| const auto | Is = [](const auto &obj)->bool { return obj; } |
| Lambda function that casts the object to bool. More... | |
| const auto | IsNullptr = [](const auto &obj)->bool { return obj == nullptr; } |
| Lambda function that return whether the object is null pointer. More... | |
| const auto | IsNotNullptr = [](const auto &obj)->bool { return obj != nullptr; } |
| Lambda function that return whether the object is not a null pointer. More... | |
| const auto | IsEmpty = [](const auto &obj)->bool { return obj.empty(); } |
| Lambda function that returns whether the object is empty. More... | |
| const auto | IsNotEmpty = [](const auto &obj)->bool { return !obj.empty(); } |
| Lambda function that returns whether the object is not empty. More... | |
| const auto | GetSize = [](const auto &obj)->std::size_t { return obj.size(); } |
| Lambda function that returns the size of an object. More... | |
| const auto | GetFirst = [](const auto &pair) { return pair.first; } |
| Lambda function that returns the first element in a pair. More... | |
| const auto | GetSecond = [](const auto &pair) { return pair.second; } |
| Lambda function that returns the second element in a pair. More... | |
| const auto | IfNotNull = [](const auto &obj_ptr, const auto Func) { if (obj_ptr != nullptr) { Func(*obj_ptr); } } |
| Lambda function that performs a callback on an if it is nor null. Otherwise it ignores it. | |
| const auto | GetX = [](const auto &o) { return o.x; } |
| Lambda function that return the x value of an object. | |
| const auto | GetY = [](const auto &o) { return o.y; } |
| Lambda function that return the x value of an object. | |
| template<typename TypeIn , typename TypeOut > | |
| const auto | StaticCast = [](const TypeIn &value) { return static_cast<TypeOut>(value); } |
| StaticCast a value to a different type. | |
Contains common lambda functions.
| const auto func::GetFirst = [](const auto &pair) { return pair.first; } |
Lambda function that returns the first element in a pair.
| const auto func::GetId = [](const auto &obj) { return obj.GetId(); } |
Lambda function that uses 'GetId' function to get object's id.
| const auto func::GetPtrId = [](const auto &obj) { return obj->GetId(); } |
Lambda function that uses 'GetId' function to get object's id.
| const auto func::GetSecond = [](const auto &pair) { return pair.second; } |
Lambda function that returns the second element in a pair.
| const auto func::GetSize = [](const auto &obj)->std::size_t { return obj.size(); } |
Lambda function that returns the size of an object.
| const auto func::Is = [](const auto &obj)->bool { return obj; } |
Lambda function that casts the object to bool.
| const auto func::IsEmpty = [](const auto &obj)->bool { return obj.empty(); } |
Lambda function that returns whether the object is empty.
| const auto func::IsNotEmpty = [](const auto &obj)->bool { return !obj.empty(); } |
Lambda function that returns whether the object is not empty.
| const auto func::IsNotNullptr = [](const auto &obj)->bool { return obj != nullptr; } |
Lambda function that return whether the object is not a null pointer.
| const auto func::IsNullptr = [](const auto &obj)->bool { return obj == nullptr; } |
Lambda function that return whether the object is null pointer.
| const auto func::OptHasValue = [](const auto &obj) { return obj.has_value(); } |
Lambda function that returns whether a std::optional has value.
| const auto func::OptValue = [](const auto &obj) { return obj.value(); } |
Lambda function that gets std::optional's value.