Comments (3)
I'm pretty sure it is. It's not only static, it is constexpr static.
It is necessary to support this syntax:
rfl::Field<std::string, "firstName">
So at compile time, the string "firstName" is copied into the class itself. I do not think that "firstName" would be persisted so I am pretty sure you couldn't just create a view.
Also, it is very important that this is all happening at compile time. So there really is no runtime overhead either way.
from reflect-cpp.
Looks like https://godbolt.org/ tricked me - string_view used to work once, but not any more.
Maybe in the future C++ versions it will work.
After translation phase 6, a string-literal that does not begin with an encoding-prefix is an ordinary string
literal. An ordinary string literal has type “array of n const char” where n is the size of the string as defined
below, has static storage duration (6.7.5), and is initialized with the given characters
from reflect-cpp.
Yes, I gave it a try myself and couldn't make it work either.
from reflect-cpp.
Related Issues (20)
- conda-forge package HOT 2
- Q: deserializing/serializing complex XML documents? HOT 6
- Reflector - separate into read and write? HOT 4
- Bug: build system assumes compiler has or is GNU-like front-end HOT 3
- Bug: number of fields in a struct is limited to 100; consider removing limitation? HOT 6
- Reflector + rfl::Flatten in ReflType HOT 2
- support for custom types HOT 2
- Compile error with structures containing bitfields HOT 1
- Can I write to buffer? HOT 1
- TaggedUnions compilation error HOT 4
- Default value of std::optional HOT 2
- Number systems support HOT 3
- SEH exception HOT 6
- std::filesystem::path support HOT 2
- inconsistent treatment of unexpected data formats / feature request DefaultIfMissing HOT 1
- Serialize tall class fails at compilation HOT 4
- RFE: Support for inclusion on Compiler Explorer HOT 4
- undefined reference to `rfl::Generic::~Generic()' HOT 4
- Stripping field name from union HOT 1
- error: implicit instantiation of undefined template 'std::tuple_size<rfl::Tuple<rfl::Field<...>>>' after #160 HOT 1
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 reflect-cpp.