This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace _append_variant() with variant_cat_t (#192)
- Loading branch information
Showing
4 changed files
with
40 additions
and
44 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 was deleted.
Oops, something went wrong.
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,32 @@ | ||
// Copyright (c) TrajoptLib contributors | ||
|
||
#pragma once | ||
|
||
#include <variant> | ||
|
||
namespace trajopt { | ||
|
||
namespace detail { | ||
|
||
//! @cond Doxygen_Suppress | ||
|
||
template <typename Variant, typename... Args> | ||
struct variant_cat; | ||
|
||
template <typename... Args0, typename... Args1> | ||
struct variant_cat<std::variant<Args0...>, Args1...> { | ||
using type = std::variant<Args0..., Args1...>; | ||
}; | ||
|
||
//! @endcond | ||
|
||
} // namespace detail | ||
|
||
/** | ||
* Defines a new variant type that appends the types Args... to the variant type | ||
* Variant. | ||
*/ | ||
template <typename Variant, typename... Args> | ||
using variant_cat_t = typename detail::variant_cat<Variant, Args...>::type; | ||
|
||
} // namespace trajopt |