diff options
Diffstat (limited to 'mojo/public/cpp/bindings/type_converter.h')
-rw-r--r-- | mojo/public/cpp/bindings/type_converter.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/mojo/public/cpp/bindings/type_converter.h b/mojo/public/cpp/bindings/type_converter.h index 395eeb4..1446ab3 100644 --- a/mojo/public/cpp/bindings/type_converter.h +++ b/mojo/public/cpp/bindings/type_converter.h @@ -7,15 +7,8 @@ #include <stdint.h> -#include <vector> - namespace mojo { -// NOTE: TypeConverter is deprecated. Please consider StructTraits / -// UnionTraits / EnumTraits / ArrayTraits / MapTraits / StringTraits if you -// would like to convert between custom types and the wire format of mojom -// types. -// // Specialize the following class: // template <typename T, typename U> struct TypeConverter; // to perform type conversion for Mojom-defined structs and arrays. Here, T is @@ -81,9 +74,6 @@ namespace mojo { template <typename T, typename U> struct TypeConverter; -template <typename T, typename U> -inline T ConvertTo(const U& obj); - // The following specialization is useful when you are converting between // Array<POD> and std::vector<POD>. template <typename T> @@ -91,18 +81,6 @@ struct TypeConverter<T, T> { static T Convert(const T& obj) { return obj; } }; -template <typename T, typename Container> -struct TypeConverter<std::vector<T>, Container> { - static std::vector<T> Convert(const Container& container) { - std::vector<T> output; - output.reserve(container.size()); - for (const auto& obj : container) { - output.push_back(ConvertTo<T>(obj)); - } - return output; - } -}; - // The following helper function is useful for shorthand. The compiler can infer // the input type, so you can write: // OutputType out = ConvertTo<OutputType>(input); |