Re: Error: cannot call public/export function someFunction from invariant

2013-10-18 Thread Andrej Mitrovic
On 10/18/13, Jonathan M Davis wrote: > If you want to call a member function from an invariant, it > should be static, or it should be a free function. I can also be private, the diagnostic is pretty clear about that. :)

Re: Error: cannot call public/export function someFunction from invariant

2013-10-18 Thread simendsjo
On Friday, 18 October 2013 at 09:08:53 UTC, Jonathan M Davis wrote: On Friday, October 18, 2013 11:04:25 bearophile wrote: simendsjo: > See topic. Why is this not allowed? The function in question > is > not virtual. > > struct S { > > void someFunction() const {} > const invariant(

Re: Error: cannot call public/export function someFunction from invariant

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 11:04:25 bearophile wrote: > simendsjo: > > See topic. Why is this not allowed? The function in question is > > not virtual. > > > > struct S { > > > > void someFunction() const {} > > const invariant() { someFunction(); } > > > > } > > void main() { > > > >

Re: Error: cannot call public/export function someFunction from invariant

2013-10-18 Thread bearophile
simendsjo: See topic. Why is this not allowed? The function in question is not virtual. struct S { void someFunction() const {} const invariant() { someFunction(); } } void main() { S s; } It being not virtual is not important. In what cases is invariant() called, simendsjo? I s

Error: cannot call public/export function someFunction from invariant

2013-10-18 Thread simendsjo
See topic. Why is this not allowed? The function in question is not virtual. struct S { void someFunction() const {} const invariant() { someFunction(); } } void main() { S s; }