Comments (4)
Never mind, I forgot to make a copy constructor that always uses the current
class instance's mup::Value for its mup::Variable instead of the other class'
mup::Value. When pushing the class to a vector with v.push_back(C()) the final
mup::Variable ended up referring to a temporary mup::Value (created in C())
which was destroyed after the push_back.
Is there a use case for having multiple mup::Variables referring to the same
mup::Value? And even if there is I guess there'd be even less use for
intentionally copying a mup::Variable which would still refer to the same
mup::Value. Deleting the copy constructor for mup::Variable would've saved a
few hours of debugging...
Original comment by [email protected]
on 23 Jul 2014 at 6:45
from muparserx.
Thanks for the clearification. There is no immediate use i can think of for
letting to variables point to the same value in regular use. There may be a
need to do it temporarily when storing Variable objects in STL containes. There
may also be the need to have a copy constructor when returning it in a tuple.
(I did not check this, just a guess...) Sorry for your debugging hours but you
know this is open source i get nothing out of it and you can rest assured that
i spent hundrets of hours coding and maintaining it.
Original comment by [email protected]
on 26 Jul 2014 at 2:12
from muparserx.
Don't worry about the hours and muparserx is a nice library. There do appear to
be some rough corner cases though, like this issue and 39. I'm not sure whether
the rule or three or five is relevant here but since there is no default
constructor there probably shouldn't be a copy constructor either. A variable
and value seem to always go together and copying a variable alone probably
doesn't make sense.
In the long run variables and values could be merged together or is either one
needed separately? Actually couldn't both be part of parser? It already has
DefineVar("r", var), why couldn't that create an internal pair of variable and
value which are exposed from parser by e.g. parser.Get("r") = 3? Another
example: if parser.Type("r") == 'm' then parser.Get("r").At(i) = 3.
Original comment by [email protected]
on 26 Jul 2014 at 5:13
from muparserx.
At some point in the future variables and values will probably merge due to
implementation reasons. Lookup with a Get("...") interface will not happen
though.
Original comment by [email protected]
on 31 Jul 2014 at 8:04
from muparserx.
Related Issues (20)
- Tag for release 4.0.9 HOT 2
- Missing header HOT 1
- README says that the version is 4.0.9 but the last tag is 4.0.8 HOT 2
- how to switch rad or gra when use trigonometric function HOT 2
- Incorrect Assignment Multiplication HOT 1
- Inconsistent Use of Signedness for Binary and Hex Numbers
- Feature Request: Add an Octal Value Reader
- logic operator lack shor-circuit feature
- 4.0.10 FTBFS HOT 1
- constant starting with letter 'o' HOT 5
- Example fails on macOS HOT 7
- int to bool conversion HOT 3
- type checking HOT 1
- xor is listed in the documentation but not implemented HOT 3
- Is it possible to directly represent a matrix instead of using many lines to define it? HOT 4
- FunTan and FunSin error HOT 2
- Is matrix algebra in SetExpr possible? HOT 2
- fail at parsing boolean linear operation HOT 2
- [4.0.12] SEGFAULT in mupTokenReader
- Example couldn't be built on MINGW windows
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 muparserx.