Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 6, 2010, 2:35:53 PM (14 years ago)
Author:
rgrieder
Message:

Removed obsolete code from Convert.h and replaced last occurrences of getConvertedValue with just two arguments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/src/libraries/util/Convert.h

    r7364 r7365  
    161161        }
    162162    };
    163 
    164     ////////////
    165     // upcast //
    166     ////////////
    167     namespace detail
    168     {
    169         // perform a static cast if ToType is a base of FromType
    170         template<class ToType, class FromType>
    171         FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<true>)
    172         {
    173             return static_cast<ToType>(input);
    174         }
    175 
    176         // return zero if ToType is not a base of FromType
    177         template<class ToType, class FromType>
    178         FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<false>)
    179         {
    180             return 0;
    181         }
    182     }
    183 
    184     // performs an upcast if ToType is a base of FromType, returns zero otherwise
    185     template <class ToType, class FromType>
    186     FORCEINLINE ToType upcast(FromType input)
    187     {
    188         enum { probe = ImplicitConversion<FromType, ToType>::exists };
    189         return detail::upcast<ToType, FromType>(input, Loki::Int2Type<probe>());
    190     }
    191163}
    192164
     
    381353    }
    382354
    383     template<class FromType, class ToType>
    384     FORCEINLINE ToType getConvertedValue(const FromType& input)
    385     {
    386         ToType output;
    387         convertValue(&output, input);
    388         return output;
    389     }
    390 
    391355    /// Directly returns the converted value, but uses the fallback on failure. @see convertValue
    392356    template<class FromType, class ToType>
     
    443407    /// Conversion would exhibit ambiguous << or >> operators when using iostream
    444408    template <>
    445     template <>
    446409    struct ConverterExplicit<unsigned char, std::string>
    447410    {
     
    453416    };
    454417    /// Conversion would exhibit ambiguous << or >> operators when using iostream
    455     template <>
    456418    template <>
    457419    struct ConverterExplicit<std::string, char>
Note: See TracChangeset for help on using the changeset viewer.