Which of them is the correct one and why?
I think it's the first one because Ts
already have the &&
or const &
associated with the type but I like to be sure and there really isn't that many examples of this particular case of noexcept
.
template <typename T>
struct Test {
T test;
// A
template <typename... Ts>
Test(Ts &&... ts) noexcept(std::is_nothrow_constructible_v<T, Ts...>)
: test(std::forward<Ts>(ts)...) {
}
// B
template <typename... Ts>
Test(Ts &&... ts) noexcept(std::is_nothrow_constructible_v<T, Ts &&...>)
: test(std::forward<Ts>(ts)...) {
}
};