-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++: Generating constructors for union types
- Added "tag-type" initialization constructors to union composite message classes - Initialization expression for union_value member of union composite types is now generated, with appropriate parameters, in copy and move constructors with allocators - Replaced alternative index hardcoding in C++14 union VariantType internal logic with IndexOf property - Symbol `rhs` has been replaced by a configured token across C++ operator and constructor overloads
- Loading branch information
1 parent
0b864b5
commit f2c57ba
Showing
12 changed files
with
423 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// AUTOGENERATED, DO NOT EDIT. | ||
// | ||
//--------------------------------------------------------------------------------------------------------------------- | ||
// Language Options | ||
{% for key, value in options.items() -%} | ||
// {{ key }}: {{ value }} | ||
{% endfor %} | ||
|
||
#ifndef NUNAVUT_SUPPORT_UTILITIES_HPP_INCLUDED | ||
#define NUNAVUT_SUPPORT_UTILITIES_HPP_INCLUDED | ||
|
||
{% ifuses "variant" -%} | ||
{%- ifuses "cetl" %} | ||
#include <cetl/pf17/utility.hpp> | ||
{%- else -%} | ||
#include <utility> | ||
{%- endifuses %} | ||
{%- else -%} | ||
#include <cstdint> | ||
{%- endifuses %} | ||
|
||
namespace nunavut | ||
{ | ||
namespace support | ||
{ | ||
|
||
// Value-specialized type for template instantiation | ||
template<std::size_t I> | ||
{%- ifuses "variant" %} | ||
{%- ifuses "cetl" %} | ||
using in_place_index_t = cetl::pf17::in_place_index_t<I>; | ||
{%- else %} | ||
using in_place_index_t = std::in_place_index_t<I>; | ||
{%- endifuses %} | ||
{%- else -%} | ||
struct in_place_index_t | ||
{ | ||
explicit in_place_index_t() = default; | ||
}; | ||
{%- endifuses %} | ||
|
||
// Type-tagging for template instantiation | ||
template<typename T> | ||
{%- ifuses "variant" %} | ||
{%- ifuses "cetl" %} | ||
using in_place_type_t = cetl::pf17::in_place_type_t<T>; | ||
{%- else %} | ||
using in_place_type_t = std::in_place_type_t<T>; | ||
{%- endifuses %} | ||
{%- endifuses %} | ||
|
||
} // end namespace support | ||
} // end namespace nunavut | ||
|
||
#endif // NUNAVUT_SUPPORT_UTILITIES_HPP_INCLUDED |
Oops, something went wrong.