I have this code:
namespace js0n
{
struct json
{
typedef int json_object;
json(){}
json(json_object const& other)
{
}
json& operator=(json_object const& other)
{
return *this;
}
};
typedef json::json_object json_object;
}
The line js0n::json json(js0n::json_object());
gives a compile error.
int main()
{
js0n::json json(js0n::json_object());
return 0;
}
Note that I've culled away much of the code, as it is not responsible for the error. What am I doing wrong?
The error message:
test.cpp: In function 'int main()':
test.cpp:9:8: error: request for member 'parse' in 'json', which is of non-class type 'js0n::json(js0n::json_object (*)()) {aka js0n::json(int (*)())}'
The assignment operators i.e. (json = json_object();
) is working just fine.