diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-22 08:42:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-22 08:42:40 +0200 |
commit | 57419407e931555cb4841b9a3cc0a01f5f60cdcc (patch) | |
tree | 1bb32e60998acc293d947eca8d71050c71154186 | |
parent | 452190bed35bdae5dc8a51ad988aae05580176a5 (diff) |
Workaround for VC9
-rw-r--r-- | odb/query.hxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/odb/query.hxx b/odb/query.hxx index d89a4e6..e8683ae 100644 --- a/odb/query.hxx +++ b/odb/query.hxx @@ -41,25 +41,33 @@ namespace odb } }; + // VC9 cannot handle certain cases of non-type arguments with default + // values in template functions (e.g., database::query()). As a result, + // we have to use the impl trick below instead of simply having kind + // as a second template argument with a default value. // - // - template <typename T, class_kind kind = class_traits<T>::kind> - struct query_selector; + template <typename T, class_kind kind> + struct query_selector_impl; template <typename T> - struct query_selector<T, class_object> + struct query_selector_impl<T, class_object> { typedef typename object_traits<T>::query_base_type base_type; typedef typename object_traits<T>::query_type type; }; template <typename T> - struct query_selector<T, class_view> + struct query_selector_impl<T, class_view> { typedef typename view_traits<T>::query_base_type base_type; typedef typename view_traits<T>::query_type type; }; + template <typename T> + struct query_selector: query_selector_impl<T, class_traits<T>::kind> + { + }; + template <typename T, typename Q = typename query_selector<T>::base_type> class query; |