Topic: Meaning of "callable
Author: ank@despammed.com (Alexander Krotov)
Date: Sun, 2 May 2004 19:45:42 +0000 (UTC) Raw View
In article <u8ygcbvh0.fsf@boost-consulting.com> David Abrahams wrote:
>> Section 8.5.3 says:
>> "The appropriate copy constructor must be callable whether or not
>> the copy is actually done."
>
> No it doesn't.
>
> "The constructor that would be used to make the copy shall be
> callable whether or not the copy is actually done."
>
> That's a crucial distinction. See paper n1610.
Sorry, I took the quote from CD2, not from the standard.
Anyway wording in the standatd still refers to "callable" and
neither n1610, nor DR291+391+450 have answer the question.
-ank
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: llewelly.at@xmission.dot.com (llewelly)
Date: Mon, 3 May 2004 16:36:01 +0000 (UTC) Raw View
ank@despammed.com (Alexander Krotov) writes:
> Section 8.5.3 says:
> "The appropriate copy constructor must be callable whether or not
> the copy is actually done."
>
> Term "callable" has not been defined anywhere in the standard and
> has been used only twice in the core language definition.
>
> Should it be understood/replaced with "accessible" ?
>
> Neither gcc nor icc(edg) check copy constructor accessibility
> in this case.
No longer true.
struct foo{};
class bar : public foo
{
bar(){}
bar(bar const&){}
friend bar get(){return bar();}
};
int main()
{
foo const& f=get();
}
g++-3.4 ank.cc
ank.cc: In function `int main()':
ank.cc:6: error: `bar::bar(const bar&)' is private
ank.cc:12: error: within this context
and similar for como online:
"ComeauTest.c", line 12: error: identifier "get" is undefined
foo const& f=get();
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dave@boost-consulting.com (David Abrahams)
Date: Sat, 1 May 2004 16:51:31 +0000 (UTC) Raw View
ank@despammed.com (Alexander Krotov) writes:
> Section 8.5.3 says:
> "The appropriate copy constructor must be callable whether or not
> the copy is actually done."
No it doesn't.
"The constructor that would be used to make the copy shall be
callable whether or not the copy is actually done."
That's a crucial distinction. See paper n1610.
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: ank@despammed.com (Alexander Krotov)
Date: Wed, 28 Apr 2004 15:56:56 +0000 (UTC) Raw View
Section 8.5.3 says:
"The appropriate copy constructor must be callable whether or not
the copy is actually done."
Term "callable" has not been defined anywhere in the standard and
has been used only twice in the core language definition.
Should it be understood/replaced with "accessible" ?
Neither gcc nor icc(edg) check copy constructor accessibility
in this case.
-ank
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: ikosarev@online.ru ("Ivan A. Kosarev")
Date: Wed, 28 Apr 2004 20:55:31 +0000 (UTC) Raw View
"Alexander Krotov" <ank@despammed.com> wrote in message
news:20040428093504.GA77878@solidtech.com...
> Section 8.5.3 says:
> "The appropriate copy constructor must be callable whether or not
> the copy is actually done."
>
> Term "callable" has not been defined anywhere in the standard and
> has been used only twice in the core language definition.
>
> Should it be understood/replaced with "accessible" ?
I think it is obvious that the sentence means that the copy constructor must
be able to be called, i. e. must be accessible.
> Neither gcc nor icc(edg) check copy constructor accessibility
> in this case.
The sentence seems like a program constraint, not a requirement for compiler
implementations.
--
Ivan
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]