Showing posts with label cpp17_constructor. Show all posts
Showing posts with label cpp17_constructor. Show all posts
May 12, 2024
Apr 12, 2022
[C++] noexcept constructor
Reference:
Using noexcept as operator and making constructor as noexcept.
e.g.
template<typename T>
struct Holder
{
T value;
template<typename... Args>
Holder(Args&&... args)
noexcept(noexcept(T(std::forward<Args>(args)...))) :
value(std::forward<Args>(args)...) {}
};
Subscribe to:
Posts (Atom)