Library-wide concepts emulation mechanism.
We decide to use Concept-style meta programming to make easy to extend, adapt and test the library. So here is our own reinvented wheel of C++ Concepts built on template constants and std::enable_if.
Classes | |
interface | OperatorNot |
Negation operator support concept. More... | |
interface | OutputIterator |
Output Iterator concept. More... | |
interface | ForwardIterator |
Forward Iterator concept. More... | |
interface | Iterable |
Iterable concept. More... | |
interface | InsertIterator |
Insert Iterator concept. More... | |
interface | CompletionToken |
Completion token concept. More... | |
interface | Handler |
Handler concept. More... | |
interface | HasDefinition |
Condition indicates if type has corresponding type traits for PostgreSQL. More... | |
Types | |
template<bool Condition, typename Type = void> | |
using | ozo::Require = Type |
Concept requirement emulation. More... | |
Variables | |
template<typename T > | |
constexpr auto | ozo::Nullable |
Indicates if type is marked as conformed to nullable requirements. More... | |
using ozo::Require = typedef Type |
Concept requirement emulation.
This is requirement simulation type, which is the alias to std::enable_if_t. It is pretty simple to use it with pseudo-concepts such as OperatorNot, Iterable and so on. E.g. overloading functions via Require:
Condition | - logical combination of concepts. |
Type | - return type, void by default. |
|
constexpr |
Indicates if type is marked as conformed to nullable requirements.
These next types are defined as Nullable
via External adaptors of the library:
If it is needed to mark type as nullable then ozo::is_nullable
from the type should be specialized as std::true_type
type. If the type has to be allocated in special way — ozo::allocate_nullable()
should be specialized (see std::shared_ptr as an example).
Raw pointers are not supported as Nullable
by default, because this library uses RAII model for objects and no special deallocation functions are used. But if it is really needed and you want to deallocate the allocated objects manually you can add them as described below.