Closed codeplea closed 3 years ago
@Malacarne I moved your question to its own thread.
To answer your question, no. I don't see any advantage in moving from C to C++, and I see a lot of disadvantages.
For starters, C programmers won't/can't use C++, but C++ programmers can easily use C.
Also, std::vector is certainly going to be slower, and TI is focused on being fast. The safety provided by std::vector doesn't appear to be a huge advantage in this use case either, as each indicator still needs to do many other checks, such as seeing that each input vector is the correct size.
That said, if somebody wanted to make a C++ wrapper, I would support that, but I don't see any advantage to porting the C code to C++.
Don't think either that would be a good use of resources -
I'm using Tulip from C++ and there's built-in ways of accessing the underlying data of e.g. a C++ vector as an array, no need to convert data..
That's a very good point.
@codeplea , have you ever thought about converting the library to a more C++ "style", and use vectors, instead of C-style arrays? I know it's easily possible to convert from one into another... but this would we a very interesting feature for future release versions...
Originally posted by @Malacarne in https://github.com/TulipCharts/tulipindicators/issues/35#issuecomment-655043352