Is the following code supposed to compile?
#include
void foo() {
const std::pair x = {1, 2};
auto [a, b] = x;
static_assert(std::is_const_v);
static_assert(std::is_const_v);
}
MSVC says "yes!".
GCC says "oh no, man!".
Clang says "no way!".
So, is this an MSVC bug?
The standard is not straightforward here (I had a quick look), but considering the rules for auto, I suppose, a and b should be copied discarding cv-qualifier.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)