-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Essentially, the implementations are extremely similar. I don't think it would take much effort to refactor Output::expand_name_
so that it can call cello::expand_name
. You probably need to allocate a vector of strings, but I think this is probably worthwhile.
This is a great task for new developers!
If you're feeling really fancy, there are a few alternatives that avoid the heap allocation. The minimally-invasive solution involves introduces a second version of cello::expand_name
that deals with more "more generalized arguments". That new version would do all of the heavy lifting and the existing version would simply call into that new version (and Output::expand_name_
would also call into the new-version). This "more generalized arguments" could
- take pointers
- make use of C++'s iterator-protocol