Comments (2)
Hi,
I've looked at Cereal in the past, but not too recently. IIRC it's like, you add the visitation function to your struct, so,
struct my_struct {
int a;
float b;
double c;
template <typename A>
void archive(A & archiver) {
archiver(a);
archiver(b);
archiver(c);
}
};
and then Cereal picks up on the existence of the archive
template member function and uses it to visit the struct.
I think that visit_struct
cannot create a compatibility layer like with Fusion and Hana to this API, because it gives me no way to determine the struct member names.
However, maybe we can make a patch in Cereal, so that if your struct does not have an ::archive
function, then it checks if it is a visitable structure and tries to use the visit_struct
api instead? Cereal would then also get the benefit of the hana and fusion compat layers I think.
from visit_struct.
It seems, you are right. I think, a patch for Cereal would be great. Thank you for the response!
no way to determine the struct member names.
Yep, apparantly, Cereal uses default names like value0
if no other name is provided:
archive( CEREAL_NVP(m1), // Names the output the same as the variable name
someInt, // No NVP - cereal will automatically generate an enumerated name
cereal::make_nvp("this_name_is_way_better", d) ); // specify a name of your choosing
from visit_struct.
Related Issues (18)
- Implement binary visitation HOT 2
- runtime versions of indexed access functions HOT 3
- Allow non-intrusive annotation of template types
- "Intrusive" Syntax and member initialization HOT 15
- Feature request: optional visitable metadata HOT 2
- if constexpr type deduction in visitor? HOT 2
- Separate parser program for 'intrusive'
- Get member variable pointer at compile-time HOT 1
- Non const visitor function arguments HOT 1
- Figure out what's wrong with `visit_struct` core on appveyor build HOT 1
- Clang: Compilation error with visitable struct include template class
- QA HOT 1
- conan package HOT 1
- compile error with boost fusion HOT 1
- New release? HOT 6
- Recursive Serialization, decltype and is_visitable behaving strangely HOT 7
- Not compiling using Intel 16.0 (with Visual Studio 2013) HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visit_struct.