Re: Error with ifstream and exceptions
Paul <pchristor@yahoo.co.uk> wrote:
You don't seem to understand what "standard" means. It's that document
they published in 1998 (and revised in 2003).
"Implementation specific" extension means by definition non-standard.
'That document' defines the language and to say something is non-standard
implies it does not not comply with the rules of the language, as defined in
the ISO document/s.
It does not make sense to say a piece of code is non standard, with your
inerpretation that 'standard' means that ISO document. This is like saying
'that code is not the ISO document'.
"Non-standard" is basically a shortcut for "doesn't comply with the C++
standard", referring to the document. You are nitpicking about wording.
You can however say that code is not standard using the word 'standard' as
defined in the english language. Meaning something along the lines of 'it is
not of the norm'.
No. When talking about C++ in particular, "non-standard" specifically
refers to not complying with the official standard document. "Norm" would
imply some kind of informal agreement or custom.
Additionally you say that *by definition* implementation specific code is
non standard
No. What I said is that an implementation-specific *extension* is by
definition non-standard. Clearly something like "__try {...}" is such
an extension (unless you have a #define macro earlier in the code that
would substitute it for something else).
well the standard I am looking at says:
"1.3.10 [defns.impl.defined]
implementation-defined behavior
behavior, for a well-formed program construct and correct data, that depends
on the implementation and
that each implementation documents"
Implementation-defined behavior and an implementation-specific extension
are two different things. "__try {...}" is clearly of the former type.
It's not something that the standard defines, but leaves the behavior up
to the compiler. (Unless you can show me where "__try" is defined in the
standard. I might have missed it.)
Additionally the code itself *IS* standard code, it may invoke non standard
behaviour but the code complies with the rules of the ISO standard.
It conforms to the standard only if you have a preprocessor macro that
substitutes "__try" and "__catch" with something valid. All by themselves
they aren't defined by the standard.
They might compile with some compiler, but that doesn't make them
standard. In that case they would be an implementation-specific extension.
Lets say I make a function called myFunction. Are you saying this is non
standard because the behaviour is not defined in the ISO Document?
The standard clearly defines function declarations and how they are
written. Does the standard define the "__try {...} __catch {...}"
syntax?
By your logic you could write Haskell inside a C++ function, and
if the compiler has an extension that understands and compiles it, that
makes it "standard".