File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,8 @@ bool ArgumentValueList::operator<=(const char* other) const{
110110
111111// Arithmetic Operators {{{2
112112ArgumentValueList ArgumentValueList::operator +(const char * other) const {
113- ArgumentValueList temp = {(std::string)at (0 ).c_str () + other};
113+ ArgumentValueList temp = vec ();
114+ temp.at (0 ) = at (0 ) + other;
114115 return temp;
115116}
116117
Original file line number Diff line number Diff line change 11#ifndef ARGPARSE_H
22#define ARGPARSE_H
3- #define ARGPARSE_VERSION 2.2.6
3+ #define ARGPARSE_VERSION 2.2.7
44#include < iostream>
55#include < sstream>
66#include < fstream>
@@ -224,31 +224,31 @@ namespace argparse{
224224 // Arithmetic Operators
225225 template <typename T>
226226 ArgumentValueList operator +(const T& other) const {
227- ArgumentValueList temp = { " " } ;
227+ ArgumentValueList temp = vec () ;
228228 temp.at (0 ) = (T)at (0 ) + other;
229229 return temp;
230230 }
231231 template <typename T>
232232 ArgumentValueList operator -(const T& other) const {
233- ArgumentValueList temp = { " " } ;
233+ ArgumentValueList temp = vec () ;
234234 temp.at (0 ) = (T)at (0 ) - other;
235235 return temp;
236236 }
237237 template <typename T>
238238 ArgumentValueList operator *(const T& other) const {
239- ArgumentValueList temp = { " " } ;
239+ ArgumentValueList temp = vec () ;
240240 temp.at (0 ) = (T)at (0 ) * other;
241241 return temp;
242242 }
243243 template <typename T>
244244 ArgumentValueList operator /(const T& other) const {
245- ArgumentValueList temp = { " " } ;
245+ ArgumentValueList temp = vec () ;
246246 temp.at (0 ) = (T)at (0 ) / other;
247247 return temp;
248248 }
249249 template <typename T>
250250 ArgumentValueList operator %(const T& other) const {
251- ArgumentValueList temp = { " " } ;
251+ ArgumentValueList temp = vec () ;
252252 temp.at (0 ) = (T)at (0 ) % other;
253253 return temp;
254254 }
You can’t perform that action at this time.
0 commit comments