summaryrefslogtreecommitdiff
path: root/libodb-mssql/odb/mssql/details/conversion.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-02-01 18:10:29 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-02-01 18:10:29 +0300
commit2895ad78dbdb43e57fc34558b4530b4e105fc72d (patch)
tree9a176c9a1a34cfa9df60fcf482bc6c360ae11214 /libodb-mssql/odb/mssql/details/conversion.hxx
parent8ac5c705c360b9ccde527eea24ddc90b2f6ed7ec (diff)
Turn libodb-mssql repository into package for muti-package repositorylibodb-mssql
Diffstat (limited to 'libodb-mssql/odb/mssql/details/conversion.hxx')
-rw-r--r--libodb-mssql/odb/mssql/details/conversion.hxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/libodb-mssql/odb/mssql/details/conversion.hxx b/libodb-mssql/odb/mssql/details/conversion.hxx
new file mode 100644
index 0000000..35f368d
--- /dev/null
+++ b/libodb-mssql/odb/mssql/details/conversion.hxx
@@ -0,0 +1,58 @@
+// file : odb/mssql/details/conversion.hxx
+// license : ODB NCUEL; see accompanying LICENSE file
+
+#ifndef ODB_MSSQL_DETAILS_CONVERSION_HXX
+#define ODB_MSSQL_DETAILS_CONVERSION_HXX
+
+#include <odb/mssql/traits.hxx>
+
+#include <odb/details/meta/answer.hxx>
+
+namespace odb
+{
+ // @@ Revise this.
+ //
+ namespace details {}
+
+ namespace mssql
+ {
+ namespace details
+ {
+ using namespace odb::details;
+
+ // Detect whether conversion is specified in type_traits.
+ //
+ template <typename T>
+ meta::yes
+ conversion_p_test (typename type_traits<T>::conversion*);
+
+ template <typename T>
+ meta::no
+ conversion_p_test (...);
+
+ template <typename T>
+ struct conversion_p
+ {
+ static const bool value =
+ sizeof (conversion_p_test<T> (0)) == sizeof (meta::yes);
+ };
+
+ template <typename T, bool = conversion_p<T>::value>
+ struct conversion;
+
+ template <typename T>
+ struct conversion<T, true>
+ {
+ static const char* to () {return type_traits<T>::conversion::to ();}
+ };
+
+ template <typename T>
+ struct conversion<T, false>
+ {
+ static const char* to () {return 0;}
+ };
+ }
+ }
+}
+
+#endif // ODB_MSSQL_DETAILS_CONVERSION_HXX