Comments (5)
This is a good point. Detecting this and adding the include could be an easy fix.
If this is not desired an other fix would be to split cpp2regex.h2
into two parts. The parsing part and the runtime part. Only the runtime part is actually required after applying @regex
.
from cppfront.
Circling back: This has now been fixed in #1219, thanks again @bluetarpmedia for pointing this out!
"Don't pay for what you don't use" FTW. 👍
from cppfront.
That's interesting... does that mean we could do both? Only conditionally include the runtime part for the lowered C++ code?
from cppfront.
an other fix would be to split
cpp2regex.h2
into two parts. The parsing part and the runtime part. Only the runtime part is actually required after applying@regex
.
When I was reviewing the PR I thought of this, but I didn't grok it well enough to know what parts are the metafunction-at-compile-time part and what part is the runtime-support-library part.
I think a good first step would be to move the metafunction-only parts right into reflect.h2
.
from cppfront.
I performed the split in #1219.
I also tried to add the functionality for adding the include on the fly. But my understanding of cppfront is too limited. Unlinke my MR for enabling metafunction to add code outside of the context (#809), this is not straight forward.
@hsutter Can you have look or give me some pointers on how to do this?
After such a change, adding the include should be something like t.add_include("#include \"cpp2regex.h2\"");
in regex_gen
.
from cppfront.
Related Issues (20)
- [BUG] ICE when putting a ; after a type definition when there is a newline in the type body HOT 6
- [DOCS] Improve documentation on syntax for function return types
- [SUGGESTION] Allow `swap` to be a hidden friend
- [SUGGESTION] allow `: ==` for anonymous alias declarations (instead of `using`) HOT 7
- [BUG] using the using keyword inside a namespace with global functions results in code that does not compile
- [BUG] using using for operators fails
- [SUGGESTION] Documenting `==` as `constexpr` and using unified declaration syntax for aliases HOT 8
- [BUG] Confusion between postifx and binary use of `&` and `*` when keyword is part of the second argument. HOT 1
- [SUGGESTION] Creating an enum instance from a raw integer HOT 6
- [SUGGESTION] add special cases for [unique.]new and shared.new when using custom deleters
- [BUG] Constant static members not initialized inside class definition
- [BUG] New clone of repo shows modification to `pure2-regex_10_escapes.cpp.execution` HOT 5
- [BUG] Regression output dpends on temporary directory HOT 1
- [BUG]
- [BUG] Error when i try to build cppfront HOT 2
- [BUG] Definite last use and lvalue reference constructor generates wrong code? HOT 2
- [BUG] Bad generated cpp1 for is constraints on wildcarded parameters HOT 2
- [BUG] Expansion of string literal with interpolation results in invalid std::format_string arg HOT 1
- [SUGGESTION] we could provide default configuration files for clang-format and clang-tidy
- [BUG] Reference docs not visible on mobile devices 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 cppfront.