Comments (4)
This issue is a duplicate of #33. Sorry, but maybe the information provided here helps too.
from better-enums.
This is also a problem if using Better Enums in a container, e.g. std::array<Boolean, 8>
. Another example is this usage of boost::program_options
:
boost::program_options::value<Boolean>(&boolean_)
->required()
What do I have to change to get rid of this bug? I think a workaround would be to initialize a Better Enum to the value of the first enumerator by default (or better: to no value, UB - same as with enum class
), but I cannot find the construction code (too much macros and templates). 😢
from better-enums.
I think I got it. I modified https://github.com/aantron/better-enums/blob/master/enum.h#L1041 and changed private
to public
. Now I still have a problem with the boost::program_options::value<Boolean>(&boolean_)
call:
D:\win-dev-env\native\boost\boost-1.63.0-x86\include\boost-1_63\boost\lexical_cast\detail\converter_lexical.hpp:243: Fehler: C2338: Target type is neither std::istream`able nor std::wistream`able
Why doesn't boost pick up the operator >>
in enum.h
?
Edit: I've used the latest release version and updated to HEAD now. Still the constructor visibility is bugged. But despite that it seems to work now.
from better-enums.
Doh, I did not see http://aantron.github.io/better-enums/DesignDecisionsFAQ.html, so nevermind. Your library is awesome. For others: This link describes how-to change default behavior.
from better-enums.
Related Issues (20)
- Static functions for enum types HOT 1
- Use in a packed struct HOT 1
- MSVC /permissive- leads to "expression did not evaluate to a constant" HOT 3
- Compiling example code: 5-map.cc fail HOT 2
- enums stops being enums HOT 1
- What is the tool to run better-enums in REPL mode in README.md? HOT 2
- Compile-time name trimming and binary size
- How to reflect to enum with type and value strings? HOT 4
- Need to have standard Debian packaging capability
- Cannot use better_enum from class HOT 1
- Using Better Enums in std::unordered_map as key leads to 'message : see reference to class template instantiation'
- Timeframe for new release / tag
- Provide an update to make_macros.py script to use python3
- Set up GitHub Actions
- C++17 interop: std::optional HOT 2
- Way to opt out of string conversion? HOT 2
- cannot add better_enum values to unordered_set HOT 3
- Member '_value' was not initialized in this constructor HOT 1
- Better-enum in maps HOT 7
- Are there guarantees on size with better enums? 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 better-enums.