Support Class Library
A set of tools providing classes and utility
NullablePointer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <scl/macros.h>
13 
14 namespace scl{
15  namespace concepts{
21  template <class T>
23  constexpr operator bool() const{
24  static_assert(AssignableWith<T, std::nullptr_t>{}, "");
25 
26  static_assert(META::is_convertible<decltype(
27  std::declval<T>() = nullptr
28  ), T&>(), "NullablePointer<T>: Assignment should return a reference");
29 
38  >();
39  }
40  };
41  }
42 }
Constructible concept, a type is constructible with the given arguments if it is destructible and met...
Definition: Constructible.h:17
constexpr bool constexpr_assert()
InequalityComparable concept, a type T is equality comparable if it defines an operator!= with itself...
Global namespace of the SCL.
Definition: alias.hpp:3
EqualityComparableWith concept, a type T is equality comparable with another type U if it defines an ...
InequalityComparableWith concept, a type T is equality comparable with another type U if it defines a...
AssignableWith concept, a type U is assignable to a type T if operator=() is defined for both types (...
constexpr bool is_convertible()
An handy function for the result of std::is_convertible.
DefaultConstructible concept, a type T is default constructible if it defines a default constructor...
NullablePointer concept, a type is said to be a nullable pointer type if its interactions w/ nullptr ...