Re: extern "C" and C++ files
On Jun 30, 4:04 pm, Alan Woodland <a...@aber.ac.uk> wrote:
Gray Alien wrote:
These are the "restrictions" I have come accross when "wrapping up" all
function declarations in a header with extern "C":
i). Inability to overload functions in exposed API
ii). Inability to include (template?) classes (e.g. string) in exposed =
API
Are there other ex/implicit restrictions I may have missed ?
I'd guess bool wouldn't be portably usable too? and one would assume
references can't be exposed to a C compiler either?
At the interface level, obviously, `extern "C"' doesn't make
much sense unless you stick to the common subset of C and C++.
(I would imagine that most, if not all, implementations, will
also make bool compatible with the C99 boolean type, and I can't
imagine an implementation where complex wasn't compatible with
it's C equivalents. But I don't think that the standards
guarantee this anywhere, and I'm not even sure how one would
formulate such guarantees.)
--
James Kanze (Gabi Software) email: james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34