#614 closed todo (done)

join() utility function

Reported by: Ichthyostega Owned by: Ichthyostega
Priority: nice Milestone: 1alpha
Component: lumieraSteam Keywords: lib smalltasks C++
Sub Tickets: Parent Tickets: #283

Description

usually, a join() utility function creates a string from some kind of container, iterator or enumeration, typically by interspersing a delimiter string, which is given as parameter.

<boost/algorithm/string/join.hpp> does exactly this, just it expects a container / a sequence of strings. What we'd need would be a join() utility function, which accepts

  • a container
  • or a pair of STL iterators
  • or a Lumiera Forward Iterator

and then automatically converts each of the elements to string.

This requires a bit of tinkering and playing with template metaprogramming to get all of these various cases behind a single API. We have already metafunctions In lib/meta/trait.hpp to distinguish a STL like container and a Lumiera Forward Iterator.

Why bothering with such a nice-to-have? Well, it saves us some copy-n-paste-programming

Change history (2)

comment:1 by Ichthyostega, at 2018-09-14T21:19:51Z

Resolution: done
Status: newclosed

Resolved some time ago, in 2015 (7fcee7496), while improving our generic diagnostic string representation. We can now display basically everything as string, and the interpolation
of an sequence into a string becomes low hanging fruit then....

comment:2 by Undercover Agent, at 2025-12-25T00:00:00Z

blocking: 283
Parent Tickets: 283

Migration MasterTickets ⟼ Subtickets-plugin

Note: See TracTickets for help on using tickets.