mirror of
https://github.com/NixOS/nix.git
synced 2025-12-13 12:31:04 +01:00
Merge pull request #14741 from NixOS/better-variant-wrapper
Fix `MAKE_WRAPPER_CONSTRUCTOR` to not override special constructors
This commit is contained in:
commit
afc2b96c5e
1 changed files with 8 additions and 6 deletions
|
|
@ -22,10 +22,12 @@
|
|||
*
|
||||
* The moral equivalent of `using Raw::Raw;`
|
||||
*/
|
||||
#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME) \
|
||||
FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \
|
||||
\
|
||||
CLASS_NAME(auto &&... arg) \
|
||||
: raw(std::forward<decltype(arg)>(arg)...) \
|
||||
{ \
|
||||
#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME) \
|
||||
FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \
|
||||
\
|
||||
template<typename... Args> \
|
||||
requires(!(sizeof...(Args) == 1 && (std::is_same_v<std::remove_cvref_t<Args>, CLASS_NAME> && ...))) \
|
||||
CLASS_NAME(Args &&... arg) \
|
||||
: raw(std::forward<Args>(arg)...) \
|
||||
{ \
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue