Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++, vectors #102

Closed
codeplea opened this issue Jul 11, 2020 · 3 comments
Closed

C++, vectors #102

codeplea opened this issue Jul 11, 2020 · 3 comments

Comments

@codeplea
Copy link
Member

@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 #35 (comment)

@codeplea
Copy link
Member Author

@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++.

@jayMcBee
Copy link

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..

@codeplea
Copy link
Member Author

That's a very good point.

@codeplea codeplea closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants