Skip to content

Commit

Permalink
Make current_*_t function constructors default and remove implicit name
Browse files Browse the repository at this point in the history
  • Loading branch information
vaijns authored and rbock committed Dec 7, 2024
1 parent 5b3b623 commit 12a30f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 78 deletions.
27 changes: 1 addition & 26 deletions include/sqlpp11/current_date.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,7 @@ namespace sqlpp
{
using _traits = make_traits<day_point, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

struct _alias_t
{
static constexpr const char _literal[] = "current_date_";
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template <typename T>
struct _member_t
{
T current_date;
T& operator()()
{
return current_date;
}
const T& operator()() const
{
return current_date;
}
};
};

constexpr current_date_t()
{
}

constexpr current_date_t() = default;
current_date_t(const current_date_t&) = default;
current_date_t(current_date_t&&) = default;
current_date_t& operator=(const current_date_t&) = default;
Expand Down
27 changes: 1 addition & 26 deletions include/sqlpp11/current_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,7 @@ namespace sqlpp
{
using _traits = make_traits<time_of_day, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

struct _alias_t
{
static constexpr const char _literal[] = "current_time_";
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template <typename T>
struct _member_t
{
T current_time;
T& operator()()
{
return current_time;
}
const T& operator()() const
{
return current_time;
}
};
};

constexpr current_time_t()
{
}

constexpr current_time_t() = default;
current_time_t(const current_time_t&) = default;
current_time_t(current_time_t&&) = default;
current_time_t& operator=(const current_time_t&) = default;
Expand Down
27 changes: 1 addition & 26 deletions include/sqlpp11/current_timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,7 @@ namespace sqlpp
{
using _traits = make_traits<time_point, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

struct _alias_t
{
static constexpr const char _literal[] = "current_timestamp_";
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template <typename T>
struct _member_t
{
T current_timestamp;
T& operator()()
{
return current_timestamp;
}
const T& operator()() const
{
return current_timestamp;
}
};
};

constexpr current_timestamp_t()
{
}

constexpr current_timestamp_t() = default;
current_timestamp_t(const current_timestamp_t&) = default;
current_timestamp_t(current_timestamp_t&&) = default;
current_timestamp_t& operator=(const current_timestamp_t&) = default;
Expand Down

0 comments on commit 12a30f9

Please sign in to comment.