Core: LambdaIze

git-svn-id: svn://ultimatepp.org/upp/trunk@15938 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-04-30 08:00:58 +00:00
parent 863f4187f0
commit b8e1c466a9
2 changed files with 26 additions and 0 deletions

View file

@ -457,3 +457,20 @@ void JsonizeBySerialize(JsonIO& jio, T& x)
throw JsonizeError("jsonize by serialize error");
}
}
template <class IZE>
struct LambdaIzeVar {
IZE& ize;
void Jsonize(JsonIO& io) { ize(io); }
void Xmlize(XmlIO& io) { ize(io); }
LambdaIzeVar(IZE& ize) : ize(ize) {}
};
template <class IO, class IZE>
void LambdaIze(IO& io, const char *id, IZE ize)
{
LambdaIzeVar<IZE> var(ize);
io(id, var);
}