Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Use init list in constructor of Args
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Mar 4, 2018
1 parent a07afba commit 8285092
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions include/clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ namespace detail {
std::vector<std::string> m_args;

public:
Args( int argc, char const* const* argv ) {
m_exeName = argv[0];
for( int i = 1; i < argc; ++i )
m_args.push_back( argv[i] );
}
Args( int argc, char const* const* argv )
: m_exeName(argv[0]),
m_args(argv + 1, argv + argc) {}

Args( std::initializer_list<std::string> args )
: m_exeName( *args.begin() ),
Expand Down

0 comments on commit 8285092

Please sign in to comment.