in the following codes,
the number of actual arguments doesn't respect that of formal arguments
is it correct or not?
I'm sure there is no function overloading in the source codes
those codes are written by other experienced programmers
so I want to make sure whether there are some mistakes or not
So far as I know , in the STL
such arguments as comp, allocator needn't be specified in the functions' arguments list when the functions are called
1 2 3 4 5 6 7
explicit set ( const Compare& comp = Compare(),
const Allocator& = Allocator() );
template <class InputIterator>
set ( InputIterator first, InputIterator last,
const Compare& comp = Compare(), const Allocator& = Allocator() );
set ( const set<Key,Compare,Allocator>& x );
The example given, set ( const Compare& comp = Compare(), const Allocator& = Allocator() ); has default arguments (the = Compare() and = Allocator() bits), so if neither are supplied the default argument is used.
See: Default values in parameters.
http://www.cplusplus.com/doc/tutorial/functions2/