dd #13
|
@ -244,3 +244,4 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2020/04/07, deniskyashif, Denis Kyashif, denis.kyashif@gmail.com
|
||||
2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com
|
||||
2020/05/31, d-markey, David Markey, dmarkey@free.fr
|
||||
2020/06/15, mattpaletta, Matthew Paletta, mattpaletta@gmail.com
|
||||
|
|
|
@ -65,16 +65,26 @@ struct ANTLR4CPP_PUBLIC Any
|
|||
return derived->value;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
template<class U, typename std::enable_if<std::is_copy_constructible<U>::value || std::is_copy_assignable<U>::value>::value>
|
||||
operator U() {
|
||||
return as<StorageType<U>>();
|
||||
}
|
||||
|
||||
template<class U>
|
||||
template<class U, typename std::enable_if<(!std::is_copy_constructible<U>::value && !std::is_copy_assignable<U>::value) && (std::is_move_constructible<U>::value || std::is_move_assignable<U>::value)>::value>
|
||||
operator U() {
|
||||
return std::move(as<StorageType<U>>());
|
||||
}
|
||||
|
||||
template<class U, typename std::enable_if<std::is_copy_constructible<U>::value || std::is_copy_assignable<U>::value>::value>
|
||||
operator const U() const {
|
||||
return as<const StorageType<U>>();
|
||||
}
|
||||
|
||||
template<class U, typename std::enable_if<!(!std::is_copy_constructible<U>::value && !std::is_copy_assignable<U>::value) && (std::is_move_constructible<U>::value || std::is_move_assignable<U>::value)>::value>
|
||||
operator const U() const {
|
||||
return std::move(as<const StorageType<U>>());
|
||||
}
|
||||
|
||||
Any& operator = (const Any& a) {
|
||||
if (_ptr == a._ptr)
|
||||
return *this;
|
||||
|
@ -99,7 +109,7 @@ struct ANTLR4CPP_PUBLIC Any
|
|||
|
||||
virtual ~Any();
|
||||
|
||||
virtual bool equals(Any other) const {
|
||||
virtual bool equals(const Any& other) const {
|
||||
return _ptr == other._ptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue