SH, shared_ptr copy/move, make MSVC happy

This commit is contained in:
Jakob Lykke Andersen 2021-06-24 11:50:31 +02:00 committed by Ralf W. Grosse-Kunstleve
parent abf11b9d9a
commit ef6907c1ae

View File

@ -9,20 +9,15 @@
namespace pybind11_tests {
namespace {
const std::string fooNames[] = {"ShPtr_", "SmHld_"};
template <int SerNo>
struct Foo {
std::string mtxt;
Foo(const std::string &mtxt_) : mtxt(mtxt_) {}
Foo(const Foo &other) = delete;
Foo(Foo &&other) = delete;
std::string get_text() const {
std::string res = "Foo";
if (SerNo == 0)
res += "ShPtr_";
else if (SerNo == 1)
res += "SmHld_";
return res + mtxt;
}
std::string get_text() const { return "Foo" + fooNames[SerNo] + mtxt; }
};
using FooShPtr = Foo<0>;