openframeworks / openframeworks/openFrameworks
more generic ofJoin
Open
Nobody has claimed this yet.
core
feature
prelim-analysis
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
feature request for a more generic ofJoin() function that accepts vectors of all kinds of objects (float, int, ofVec2f, etc) rather than just string. anything that implements operator<<
here's an example using stl:
#include <iterator>
template <class T>
string ofJoin(vector<T>& elements, string delimiter) {
stringstream result;
copy(elements.begin(), elements.end(), ostream_iterator<T>(result, delimiter.c_str()));
return result.str();
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the existing ofJoin() implementation and any tests or examples covering it. Compare its current string-only behavior with the provided ostream_iterator approach, then verify that supported object types using operator<< are joined correctly while existing string usage remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100