mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Core: LambdaIze
git-svn-id: svn://ultimatepp.org/upp/trunk@15938 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
863f4187f0
commit
b8e1c466a9
2 changed files with 26 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue