mirror of
https://github.com/NixOS/nix.git
synced 2025-12-16 14:01:05 +01:00
Fix MAKE_WRAPPER_CONSTRUCTOR to not override special constructors
It should not effect move / copy / etc. constructors.
This commit is contained in:
parent
907a5761fa
commit
e73bb666c5
1 changed files with 8 additions and 6 deletions
|
|
@ -22,10 +22,12 @@
|
||||||
*
|
*
|
||||||
* The moral equivalent of `using Raw::Raw;`
|
* The moral equivalent of `using Raw::Raw;`
|
||||||
*/
|
*/
|
||||||
#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME) \
|
#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME) \
|
||||||
FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \
|
FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \
|
||||||
\
|
\
|
||||||
CLASS_NAME(auto &&... arg) \
|
template<typename... Args> \
|
||||||
: raw(std::forward<decltype(arg)>(arg)...) \
|
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