Original Post
I need to pass by reference so that the object changes its value after returning. this is the code that I assume would function properly. However, end up with a compile error. new_shenu.cpp:18: error: no matching function for call to `Print::Parameter(std::map, std::allocator > >)' Print.h:37: note: candidates are: void Print::Parameter(std::map, std::allocator > >&) Why? well, I've seen some people use the const keyword, so I tried and i was successful in compiling but I know then I won't be able to change the data.
//print.h
void Path( std::map<std::string, std::string>& path );
..
..
//parameter.h
std::map<std::string, std::string> GetParameter(){
return fieldData;
};
..
..
//main
main(){
print::Instance().Parameter( parameter.GetParameter() );
}
//print.h
void Path( const std::map<std::string, std::string>& path );
..
..