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

Commit 8285092

Browse files
committed
Use init list in constructor of Args
1 parent a07afba commit 8285092

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

include/clara.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ namespace detail {
6767
std::vector<std::string> m_args;
6868

6969
public:
70-
Args( int argc, char const* const* argv ) {
71-
m_exeName = argv[0];
72-
for( int i = 1; i < argc; ++i )
73-
m_args.push_back( argv[i] );
74-
}
70+
Args( int argc, char const* const* argv )
71+
: m_exeName(argv[0]),
72+
m_args(argv + 1, argv + argc) {}
7573

7674
Args( std::initializer_list<std::string> args )
7775
: m_exeName( *args.begin() ),

0 commit comments

Comments
 (0)