Comments (5)
Figured out a way to put back the static_assert
without breaking use with lambdas, see 4a11277.
from leaf.
I'd like to get some more feedback that this is a problem before removing the static_assert
, IMO the better diagnostics outweighs this potential problem. Do you mind giving me a bit more context, what lead you to hit this problem?
from leaf.
I totally understand not wanting to remove the static_assert
, and I don't think you should (unless there's some equivalent alternative). My thought was to add some additional unchecked macros for this situation, but I can also understand not wanting to complicate things. Something along the lines of BOOST_LEAF_ASSIGN_UNCHECKED
etc.
I'm experimenting with porting some code over from Outcome that uses lambdas fairly liberally, and creating named variables for each is a good bit of extra work/clutter. If I understand correctly this is an issue with passing lambdas inline to any function that might fail, which seems like a reasonably common pattern.
For me it's easy enough to define my own macros until I can move to c++20, but it seemed like something that might be nice to have documented in the issues for other people that run into it. No big deal if there's no fix on your end.
from leaf.
I got convinced that this is a problem. It is now fixed on develop
, I also added a unit test. See e9eb032. Thanks!
from leaf.
Awesome! Thank you!
from leaf.
Related Issues (20)
- explicit conversion constructor called implicitly in result<T> -> result<U> conversion HOT 1
- Better documentation of the core mechanism HOT 9
- exception() requires an rvalue-reference for its exception parameter. HOT 2
- No error_id loaded when catching an non-leaf::exception HOT 15
- Documentation unclear on how to test the error-returning functions HOT 4
- Question: How to correctly rethrow/propagate? HOT 3
- How to catch objects from upper levels of class hierarchy? HOT 8
- BOOST_LEAF_CFG_CAPTURE must be 1 for single-header build to compile HOT 6
- Add leaf to the Conan Center Index HOT 3
- Failing to use leaf with Conan and CMake HOT 4
- new_error not throw error from error_handler HOT 3
- Dead PDF doc link HOT 1
- FEATURE: Store all error objects when verbose_diagnostic_info is in try_handle_all handlers HOT 10
- Should leaf::result be [[nodiscard]]? HOT 4
- Should leaf::result::value_type be public? HOT 2
- Should LEAF provide allocating context for simple multi-thread error handling? HOT 4
- Slightly modified exception_error_log example does not produce expected output HOT 3
- Few best practice questions HOT 5
- Providing leaf::result with forwarding constructor and emplace method HOT 2
- Modular Boost C++ Libraries Request 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 leaf.