According to cppreference, the following code is legal:
lock_guard( MutexTypes&... m, std::adopt_lock_t t );
However, the following code cannot be compiled with clang 3.8 (-std=c++1z):
template<typename... Args>
void f(Args&&..., bool)
{}
int main()
{
f(1, 2, 3, true); // error! see below for details.
}
1>main.cpp(59,2): error : no matching function for call to 'f' 1> f(1, 2, 3, true); 1> ^ 1> main.cpp(54,6) : note: candidate function not viable: requires 1 argument, but 4 were provided 1> void f(Args&&..., bool) 1> ^ 1> 1 error generated.
Does C++ allow normal parameters after variadic parameters?