https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70472

--- Comment #8 from Askar Safin <safinaskar at mail dot ru> ---
Recently I noticed this bug can be easily fixed simply by manually implementing
is_copy_constructible. So, please, apply the fix. And same for other type
traits (is_copy_assignable etc).

#include <vector>
#include <type_traits>
#include <iostream>
#include <memory>

namespace std{
template <typename _Tp> struct is_copy_constructible<std::vector<_Tp>> : public
is_copy_constructible<_Tp>
{
};
}

struct foo
{
  std::vector<foo> x;             
};                                

struct bar
{
  std::vector<bar> x;
  std::unique_ptr<int> y;
};

// First column is what we want, second is actual result
int
main ()
{
  std::cout << "1 " << std::is_copy_constructible<std::vector<int>>::value <<
"\n";
  std::cout << "0 " <<
std::is_copy_constructible<std::vector<std::unique_ptr<int>>>::value << "\n";
  std::cout << "1 " << std::is_copy_constructible<foo>::value << "\n";
  std::cout << "0 " << std::is_copy_constructible<bar>::value << "\n";
}

Reply via email to