mercredi 24 avril 2019

std::is_constructible on incomplete type

I have the following code:

#include <iostream>

class A;

int main()
{
    std::cout << std::is_constructible<A>::value << std::endl;
}

When I use GCC 8.3 (see here for live example), this code compiles. However, when I use Clang 8.0 (see here for live example), I get a compilation error that incomplete types cannot be used in type traits. Which one is correct? Am I allowed to use is_constructible on an incomplete type (with an expected value of false), or am I not allowed to?

Aucun commentaire:

Enregistrer un commentaire