Author: faridz
Date: Fri May 25 06:13:16 2007
New Revision: 541635
URL: http://svn.apache.org/viewvc?view=rev&rev=541635
Log:
2007-05-25 Farid Zaripov <[EMAIL PROTECTED]>
STDCXX-378
* dynatype.cpp: Removed dynatype::operator T&() to resolve
ambiguity between user defined conversions on MSVC.
Modified:
incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp
Modified: incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp?view=diff&rev=541635&r1=541634&r2=541635
==============================================================================
--- incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp (original)
+++ incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp Fri May 25 06:13:16
2007
@@ -88,20 +88,13 @@
(this->*p_remove)();
}
- // retrieve a reference to the concrete type from an instance of
+ // retrieve a value of the concrete type from an instance of
// dynatype throws std::bad_cast if the types don't match exactly
template <class T>
- operator T& () {
+ operator T () const {
if (map<T>::get ().end () == map<T>::get ().find (this))
throw std::bad_cast ();
return map<T>::get () [this];
- }
-
- // retrieve a value of the concrete type from an instance of
- // dynatype throws std::bad_cast if the types don't match exactly
- template <class T>
- operator T () const {
- return static_cast<T&> (*const_cast<dynatype*>(this));
}
// assign a value of any type to an instance of dynatype