Re: #pragma once in ISO standard yet?
Andre Kaufmann wrote:
:: Bo Persson wrote:
::: Andre Kaufmann wrote:
::: [...]
::: And if it doesn't work, how are you as a programmer going to fix
::: that?
::
:: 1) Change the environment
:: 2) Use both - #pragma comment and include guards
:: 3) The programmer is not responsible for the infrastructure
:: that's the task of the it administrator
1) I cannot
2) Doesn't help much does it? If the #pragma once makes the compiler
NOT include the file, I'm toast!
3) He won't change it, and points me to the company wide standard for
PC nad network configurations.
:: 4) But there are always other solutions - see below
ok.
::
:::
::: As a somewhat nasty example, I have a PC at work, which I cannot
::: configure myself, with
:::
::: local hard disk
::: several (non-unique) mounts to Windows servers (group and
::: departmental)
::: several SAN mounts
::: access to a ClearCase mount on a UNIX server
::: one drive letter mapping to files on a zOS mainframe
::
:: Copy the sources and directory structure to your local PC and
:: compile them from there ?
:: Anyways better to compile on a local machine than compiling over
:: network , or am I totally wrong ?
::
:: Must any nasty hardware construction/topology be supported or
:: should the hardware infrastructure be adopted to the compiler ?
You tell me!
So I go to the corporate IT manager (vice president) and tell him that
the setup of our international WAN is incorrect, because it doesn't
support the #pragma once feature of my C++ compiler.
Do you think he will order a reconfiguration? :-)
::
::
::: How should the C++ standard specify #pragma once, so that it
::: always works? Or should it be unportable?
::
:: You can always choose to additionally use include guards - can't
:: you ? And C++ can't be (fully) ported to every platform. If you
:: restrict the compiler always to the lowest common platform you
:: will effectively restrict the language itself.
Specifying a standard feature that we know cannot be implemented on
some platforms, surely makes the language less useful. The other part
of the problem is that it somehow forces the compiler writer to
consider network topologies. Hardly the right place for that.
:: All in all, header files are causing too much troubles. So it's
:: best to get rid of them as soon as possible. They aren't worth the
:: trouble.
Something better than headers would be nice. We should just don't do
it in a way that reduces the number of platforms available to C++.
Bo Persson
---
[ 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.comeaucomputing.com/csc/faq.html ]