-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Motivating example:
template <typename EnumType>
class value_traits<EnumType, id_string, typename std::enable_if<std::is_enum<EnumType>::value>::type>
{
public:
using query_type = EnumType;
static void set_value(
EnumType& value,
details::buffer const& buffer,
std::size_t n,
bool isNull)
{
// deserialize database string to any enum value
}
static void set_image(
details::buffer& buffer,
std::size_t& n,
bool& isNull,
EnumType const& value)
{
// Serialize any enum value to database string
}
};To make this work would require changing the value_traits template from:
template <typename T, database_type_id ID>
class value_traits: public select_traits<T, ID>::type
{
};To:
template <typename T, database_type_id ID, typename = void>
class value_traits: public select_traits<T, ID>::type
{
};Which will break all the existing code that expects the old template.
So while the idea is good, we need to think how we can implement it without break backwards compatibility.
Metadata
Metadata
Assignees
Labels
No labels