# HG changeset patch # User David Demelier # Date 1563300060 -7200 # Node ID 913c8ef054d3cf92b07eb35f8d94343a8cf62919 # Parent e40d082f916122346aa71a0239192edd59df411a options: templatize initializer_list overload diff -r e40d082f9161 -r 913c8ef054d3 cpp/options/options.hpp --- a/cpp/options/options.hpp Mon Jul 15 21:05:00 2019 +0200 +++ b/cpp/options/options.hpp Tue Jul 16 20:01:00 2019 +0200 @@ -1,5 +1,5 @@ /* - * options.hpp -- getopt(3) similar interface for C++ + * options.hpp -- C++ similar interface to getopt(3) * * Copyright (c) 2019 David Demelier * @@ -21,9 +21,10 @@ /** * \file options.hpp - * \brief C++ alternative to getopt(3). + * \brief C++ similar interface to getopt(3). */ +#include #include #include #include @@ -32,7 +33,7 @@ #include /** - * \brief C++ alternative to getopt(3). + * \brief C++ similar interface to getopt(3). */ namespace options { @@ -127,7 +128,8 @@ * \param fmt the format string * \return the result */ -inline auto parse(std::initializer_list args, std::string_view fmt) -> pack +template +inline auto parse(std::initializer_list args, std::string_view fmt) -> pack { return parse(args.begin(), args.end(), fmt); }