diff --git a/include/sqlpp11/limit.h b/include/sqlpp11/limit.h index 7e19696b..4205be16 100644 --- a/include/sqlpp11/limit.h +++ b/include/sqlpp11/limit.h @@ -52,16 +52,6 @@ namespace sqlpp using _is_limit = std::true_type; using _is_dynamic = std::true_type; - dynamic_limit_t(): - _limit(0) - {} - - dynamic_limit_t(const dynamic_limit_t&) = default; - dynamic_limit_t(dynamic_limit_t&&) = default; - dynamic_limit_t& operator=(const dynamic_limit_t&) = default; - dynamic_limit_t& operator=(dynamic_limit_t&&) = default; - ~dynamic_limit_t() = default; - void set(std::size_t limit) { _limit = limit; @@ -75,7 +65,7 @@ namespace sqlpp os << " LIMIT " << _limit; } - std::size_t _limit = 0; + std::size_t _limit; }; } diff --git a/include/sqlpp11/offset.h b/include/sqlpp11/offset.h index 159193aa..2ed223f9 100644 --- a/include/sqlpp11/offset.h +++ b/include/sqlpp11/offset.h @@ -51,15 +51,6 @@ namespace sqlpp using _is_offset = std::true_type; using _is_dynamic = std::true_type; - dynamic_offset_t(): - _offset(0) - {} - dynamic_offset_t(const dynamic_offset_t&) = default; - dynamic_offset_t(dynamic_offset_t&&) = default; - dynamic_offset_t& operator=(const dynamic_offset_t&) = default; - dynamic_offset_t& operator=(dynamic_offset_t&&) = default; - ~dynamic_offset_t() = default; - void set(std::size_t offset) { _offset = offset; @@ -72,7 +63,7 @@ namespace sqlpp os << " OFFSET " << _offset; } - std::size_t _offset = 0; + std::size_t _offset; }; } diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index d2b8a3d0..82fb0869 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -454,7 +454,7 @@ namespace sqlpp }; } - auto dynamic_limit() + auto dynamic_limit(std::size_t limit = 0) ->set_limit_t { static_assert(not is_noop::value, "cannot call limit() without a from()"); @@ -467,7 +467,7 @@ namespace sqlpp _group_by, _having, _order_by, - {}, + {limit}, _offset, }; } @@ -499,7 +499,7 @@ namespace sqlpp }; } - auto dynamic_offset() + auto dynamic_offset(std::size_t offset = 0) -> set_offset_t { static_assert(not is_noop::value, "cannot call offset() without a limit"); @@ -513,7 +513,7 @@ namespace sqlpp _having, _order_by, _limit, - {}, + {offset}, }; }