diff --git a/include/sqlpp11/result.h b/include/sqlpp11/result.h index b38cf86b..024dfc85 100644 --- a/include/sqlpp11/result.h +++ b/include/sqlpp11/result.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2017, Roland Bock, Aaron Bishop * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -40,27 +40,21 @@ namespace sqlpp namespace detail { - template - struct result_has_size : std::false_type {}; + template + struct result_has_size : std::false_type {}; - template - struct result_has_size().size())>> - : std::true_type {}; + template + struct result_has_size().size())>> + : std::true_type {}; - template - constexpr bool result_has_size_v = result_has_size::value; + template + struct result_size_type { using type = void; }; - template - struct result_size_type { using type = void; }; - - template - struct result_size_type().size())>> - { - using type = decltype(std::declval().size()); - }; - - template - using result_size_type_t = typename result_size_type::type; + template + struct result_size_type().size())>> + { + using type = decltype(std::declval().size()); + }; } template @@ -165,12 +159,12 @@ namespace sqlpp _result.next(_result_row); } - template> - Size size() const - { - static_assert(detail::result_has_size_v, "Underlying connector does not support size()"); - return _result.size(); - } + template::type> + Size size() const + { + static_assert(detail::result_has_size::value, "Underlying connector does not support size()"); + return _result.size(); + } }; } // namespace sqlpp