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:
parent
907a5761fa
commit
e73bb666c5
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