-
Hello guys. struct aa
{
std::string tt;
int ii;
};
namespace soci
{
// name-based conversion
template<> struct type_conversion<aa>
{
typedef values base_type;
static void from_base(values const &v, indicator /* ind */, aa &p)
{
// ignoring possibility that the whole object might be NULL
p.tt = v.get<std::string>("tt");
p.ii = v.get<int>("ii");
}
static void to_base(aa const & p, values & v, indicator & ind)
{
v.set("tt", p.tt);
v.set("ii", p.ii);
}
};
} |
Beta Was this translation helpful? Give feedback.
Answered by
zann1x
Aug 29, 2023
Replies: 1 comment 1 reply
-
The error sounds like you're trying to use a type that has no supported conversion method. But based on the code snippet you provided, I can't see where that should be the case. You'd need to provide the context in which/how you're calling this |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
330305020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The error sounds like you're trying to use a type that has no supported conversion method. But based on the code snippet you provided, I can't see where that should be the case. You'd need to provide the context in which/how you're calling this
type_conversion
for further help on this.