I'm getting errors when I call a function which uses a default argument.
The two files are cache.cpp and cache.h
Command I use to compile is
g++ -c cache.cpp
and the error is:
cache.cpp: In member function ‘bool mem::read(long unsigned int)’:
cache.cpp:205:88: error: no matching function for call to ‘vcache::swap(long unsigned int&, bool&)’
cache.h:97:23: note: candidate is: long unsigned int vcache::swap(long unsigned int, bool, int)
cache.cpp: In member function ‘void mem::write(long unsigned int)’:
cache.cpp:367:92: error: no matching function for call to ‘vcache::swap(long unsigned int&, bool&)’
cache.h:97:23: note: candidate is: long unsigned int vcache::swap(long unsigned int, bool, int)
As you can see on line #569 where the function vcache::swap has been defined, I've provided a default value to the 3rd argument. The problem arises when I don't specify the 3rd argument during the function call. If I run this by explicitly specifying a 3rd argument, it compiles properly.
Am unable to understand why this is happening.
cache.cppand line 97 incache.h.