1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-13 04:21:04 +01:00

Fix MAKE_WRAPPER_CONSTRUCTOR to not override special constructors

It should not effect move / copy / etc. constructors.
This commit is contained in:
John Ericson 2025-12-08 13:20:56 -05:00
parent 907a5761fa
commit e73bb666c5

View file

@ -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)...) \
{ \
}