Kornel Benko <[EMAIL PROTECTED]> writes:
> It is very fishy here.
> If I replace the call with:
>       string a("");
>         Buffer buffer(a, false);
> then it compiles.
> 
> On the other hand
>       string a();
>       Buffer buffer(a, false);
> yields to
>       CutAndPaste.C:676: error: no matching function for call to 
`lyx::Buffer::Buffer
>    (std::string (&)(), bool)'
> buffer.h:73: error: candidates are: lyx::Buffer::Buffer(const lyx::Buffer&)
> buffer.h:92: error:                 lyx::Buffer::Buffer(const std::string&,
>    bool)

That's not fishy at all.

   string a("");

defines a variable "a" and initializes it with "". The same thing is achieved 
more elegantly and less expensively with:

   string a;

By way of contrast,

   string a();

is a declaration of a function "a" that takes no arguments and returns a 
string...

If you look a little closely at the error message, you'll see that the 
compiler is even trying to tell you that.

Regards,
Angus

Reply via email to