Skip to content

Commit

Permalink
Basic version of Variant type using C++11 (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyRyabinin authored Mar 1, 2024
1 parent 98d68a1 commit 52ea412
Show file tree
Hide file tree
Showing 4 changed files with 966 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/aws/crt/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ namespace Aws
};
static constexpr InPlaceT InPlace{};

template <typename T> struct InPlaceTypeT
{
explicit InPlaceTypeT() = default;
};
/** Variable templates are only available since C++14
* Use a dummy object "Aws::Crt::InPlaceTypeT<T>() in-place instead in C++11"*/
#if defined(__cplusplus) && __cplusplus > 201103L //
template <class T> static constexpr InPlaceTypeT<T> InPlaceType{};
#endif

} // namespace Crt
} // namespace Aws
Loading

0 comments on commit 52ea412

Please sign in to comment.