I just released a project I've been working on for a while, and would appreciate any opinions, comments, etc. anyone might have about it. It's a math parsing library, and can be found here: https://sourceforge.net/projects/ub3rmath/
Tried it out, but came up with an error. Could not #include <unordered_map> from the math library. What library or include, is this from? I'm using Microsoft Visual C++ 2008 Express Edition.
Thanks for clarifying that for me ne555. At least I won't keep attempting to use it, til I get the newer compiler. I found the mentioned source code by going to the above https site, but leaving off the last forward slash.
Thank you very much for the response,
I am currently working on those, and in the mean time have updated it to use std::map instead of std::unordered_map. It's a hit on performance, but eliminates the need to support the new standard.
Isn't there a pre-defined symbol for C++11 that you can use to conditionally use either one, assuming they work the same (same method names and such)? If not you can always #define your own.
I see in ConstantesManipulation.cpp that you pass string by value. This is very bad for performances, consider using const& string to avoid copy.
In general, the only types you sould pass by value are primitives types(int, float, double, char, pointers) and very small types designed to be passed by value like iterators and functors.
The only benefit to pass by value is to not have indirection when using the parameter.
Another idea for performance: in your main loop in Solver.cpp, you do this:
1 2 3 4
string nextChunk = GetNextChunk(&equation);
/* some code which don't use the string value of nextChunk but its type with GetChunkType */
switch (getChunkType(nextChunk)
/* ... */
I think it would be better not to treat chunk as string as it doesn't not hold the real information you want to manipulate. In fact, GetNextChunk already knows the data in your chunk because it parse it. So it should return something like a boost::variant<float, string, operator,...> (a variant is a type which can hold data of multiple types and knows about the data of its type). Thus you don't have to call GetChunkType multiple times.
If you don't want to use boost::variant you can easily create your own with an union and an enum for exemple.