Meaning of "callable"

Meaning of "callable"

Post by ank » Fri, 30 Apr 2004 00:56:56


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.yqcomputer.com/ ]
 
 
 

Meaning of "callable"

Post by ikosare » Fri, 30 Apr 2004 05:55:31


I think it is obvious that the sentence means that the copy constructor must
be able to be called, i. e. must be accessible.


The sentence seems like a program constraint, not a requirement for compiler
implementations.


---
[ 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.yqcomputer.com/ ]

 
 
 

Meaning of "callable"

Post by dave » Mon, 03 May 2004 01:51:31


XXXX@XXXXX.COM (Alexander Krotov) writes:


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.yqcomputer.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.yqcomputer.com/ ]
 
 
 

Meaning of "callable"

Post by ank » Tue, 04 May 2004 04:45:42


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.yqcomputer.com/ ]
 
 
 

Meaning of "callable"

Post by llewelly.a » Wed, 05 May 2004 01:36:01


XXXX@XXXXX.COM (Alexander Krotov) writes:


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.yqcomputer.com/ ]