commit
98dc2c0f02
|
@ -182,3 +182,4 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com
|
||||
2018/02/11, io7m, Mark Raynsford, code@io7m.com
|
||||
2018/15/05, johnvanderholt, jan dillingh johnvanderholte@gmail.com
|
||||
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
|
|
@ -11,6 +11,3 @@ Any::~Any()
|
|||
{
|
||||
delete _ptr;
|
||||
}
|
||||
|
||||
Any::Base::~Base() {
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ struct ANTLR4CPP_PUBLIC Any
|
|||
|
||||
private:
|
||||
struct Base {
|
||||
virtual ~Base();
|
||||
virtual ~Base() {};
|
||||
virtual Base* clone() const = 0;
|
||||
};
|
||||
|
||||
|
@ -112,10 +112,21 @@ private:
|
|||
|
||||
T value;
|
||||
|
||||
Base* clone() const {
|
||||
return clone<>();
|
||||
}
|
||||
|
||||
private:
|
||||
template<int N = 0, typename std::enable_if<N == N && std::is_nothrow_copy_constructible<T>::value, int>::type = 0>
|
||||
Base* clone() const {
|
||||
return new Derived<T>(value);
|
||||
}
|
||||
|
||||
template<int N = 0, typename std::enable_if<N == N && !std::is_nothrow_copy_constructible<T>::value, int>::type = 0>
|
||||
Base* clone() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Base* clone() const
|
||||
|
|
Loading…
Reference in New Issue