0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Removed templated variables

Also fixed tabs to spaces. Used github editor, can update later if there was a syntax error.
This commit is contained in:
Aaron Bishop 2017-10-23 09:10:10 -04:00 committed by GitHub
parent fb84f9b4a9
commit d207a26638

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2015, Roland Bock * Copyright (c) 2013-2017, Roland Bock, Aaron Bishop
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -47,9 +47,6 @@ namespace sqlpp
struct result_has_size<DbResult, void_t<decltype(std::declval<DbResult>().size())>> struct result_has_size<DbResult, void_t<decltype(std::declval<DbResult>().size())>>
: std::true_type {}; : std::true_type {};
template<class DbResult>
constexpr bool result_has_size_v = result_has_size<DbResult>::value;
template<class DbResult, class = void> template<class DbResult, class = void>
struct result_size_type { using type = void; }; struct result_size_type { using type = void; };
@ -58,9 +55,6 @@ namespace sqlpp
{ {
using type = decltype(std::declval<DbResult>().size()); using type = decltype(std::declval<DbResult>().size());
}; };
template<class DbResult>
using result_size_type_t = typename result_size_type<DbResult>::type;
} }
template <typename DbResult, typename ResultRow> template <typename DbResult, typename ResultRow>
@ -165,10 +159,10 @@ namespace sqlpp
_result.next(_result_row); _result.next(_result_row);
} }
template<class Size = detail::result_size_type_t<DbResult>> template<class Size = typename detail::result_size_type<DbResult>::type>
Size size() const Size size() const
{ {
static_assert(detail::result_has_size_v<DbResult>, "Underlying connector does not support size()"); static_assert(detail::result_has_size<DbResult>::value, "Underlying connector does not support size()");
return _result.size(); return _result.size();
} }
}; };