Add bt2c::join()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 10 May 2024 19:32:10 +0000 (15:32 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commit6875eb64630a6d722fdd8336d4282d56a240dcd0
treeffd7d23b49289ab6056b1b5953c2e78944363f84
parent683aa0c2ca8668de6919c496faefd5484e807925
Add bt2c::join()

This new function template joins the strings of some container with
some delimiter.

The container needs a forward iterator and its elements need the data()
and size() methods.

The container may be empty.

For example:

    int main()
    {
        std::cout << bt2c::join(std::vector<std::string> {
            "salut", "meow", "mix"
        }, ", ") << '\n';
    }

will print

    salut, meow, mix

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id3ff90cf3b2fa4336b71860dbe3c0dff83668607
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12735
src/Makefile.am
src/cpp-common/bt2c/join.hpp [new file with mode: 0644]
This page took 0.024434 seconds and 4 git commands to generate.