standard encoding for float?

Is the encoding for float platform independent That is, if I take
the four bytes, stick them into an ethernet packet send them to
another machine, then (after endian swapping and alignment), set a
float pointer to point at those four bytes, will I get the same
value It seems to work on the plaforms I have, but this is suppose
to work for any machine types -- so I guess my question is, is the
encoding of float standardized

next ISO C++ standard
&nbsp(139 Views)
Current ISO C++ standard is ISO C++ 1998. Am I correct
When is the next standard expected What is the URL for knowing it
Will it contain libraries for network programming as part of the
standard library .(just as data structures and algorithms were
included as part ISO C++ 1998 standard library).
Kindly clarify.

#pragma once in ISO standard yet?
&nbsp(130 Views)
I'm told that "#pragma once" has made it into the ISO standard for
either C or C++. I can't find any reference to that anywhere. If
it's true, do any of you have a reference I can use

streambuf::overflow -- what does the standard say ?
&nbsp(134 Views)
I'm working on a basic_streambuf subclass as
a frontend for devices which might accept some
but, may be not all characters in one go when
writing.
so
device::write(const CharT,std::streamsize 10);
might return something between 1...10 indicating
that just a portion of the deed buffer has been
written. This should be covered within the
'overflow' method of my basic_streambuf subclass.
When consulting the IOStream book of Langer & Kreft
they only point out that overflow should make some
space available within the output buffer. May be
even by simply resizing the buffer. However if
I look at the fstream_buf implementation of my
g++lib (4.1.2) I find that basic_filebuf::close
calls 'overflow' in order to write all remaining
CharT to the underlying device, which as far as
I can see should be a job for 'sync'.
And 'overflow' is virtual which one may
interprete as an invitation
to overwrite it and brake the silent contract
between 'overflow' and 'close', that all CharT
will happily end up in the file.
So -- the question: Is overflow supposed to write
the whole buffer, or as L&K state it just tries to make
some space available
Please no discussion how evil it is to subclass
basic_filebuf etc. ;-)
Thank you very much indeed..
O.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

The reuse of keywords in the C++ standard
&nbsp(133 Views)
Posted here because comp.std.c++ seems to have died an unexpected death.
-------
I note with some dismay the proposal to create a new meaning for the C and
C++ keyword 'auto', as described in the document N1984 (part of the
proposals for C++0X or whatever it's called now). Efforts are being taken to
ensure it doesn't conflict with the previous meaning of the keyword, but why
not simply have a whole new keyword These aren't stupid, so I assume
there must be a good reason.
'Chops
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

#pragma once in ISO standard yet?
&nbsp(129 Views)
I'm told that "#pragma once" has made it into the ISO standard for
either C or C++. I can't find any reference to that anywhere. If
it's true, do any of you have a reference I can use

Possible to access standard global new operator after it's beenoverridden?
&nbsp(147 Views)
Is it possible to access the standard global new operator after it's been
overridden For instance, I have a situation like this
void* operator new( size_t numBytes )
{
return sDefaultHeap->ocate( numBytes );
}
Heap::Heap( unsigned int memSize )
{
// allocate memory for the heap
m_memory = new char[ memSize ];
}
void InitDefaultHeap( void )
{
// this function doesn't currently work because new has been
// overridden
char* defaultMem = new char[1024];
sDefaultHeap( defaultMem, 1024 );
}
The overridden new allocates from the default heap, but the problem is
that default heap must be allocated using the standard new operator and
not the overridden one. Is this possible My heap class (not the one
shown) can take external allocations to take care of the default heap
case, but I can't seem to figure out how to make this all work.

Template technicality - What does the standard say?
&nbsp(120 Views)
I've been using Visual C++ 2003 for some time, and recently started
working on making my code compile in GCC and MinGW. I hit on lots of
unexpected problems which boil down to the same template issue. A
noddy mixin layer example should illustrate the issue...
class Base
{
protected:
int m_Field;
public:
Base () : m_Field (0) {}
};
template class Derived : public T
{
public:
void Inc ()
{
T::m_Field++; // GCC needs the "T::" here - VC++ doesn't
}
};
In the above, the idea is to use Derived, but GCC (3.4.5 and
4.1.2) gives error messages even if you never instantiate the
template.
There are of course examples of similar templates in Stroustrup, but
because they are incomplete examples, I can't find one that shows an
inherited member being referenced from within the template class.
In non-template classes, scope resolution is only needed to access
inherited members if there is an ambiguity. There is no ambiguity in
the above - the only place m_Field can come from is the inherited
class Base via the template parameter T. Following that general
principle, I don't see any reason why scope resolution should be
needed.
What does the standard say about this - should the scope resolution
operator be required If it is required, what's the rationale If
there's something in Stroustrup about this, can you point me to the
right section

Looking for tutorial C++ source code (standard)
&nbsp(177 Views)
I have been reading the book "Thinking in C++", and frankly, I am
getting sick and tired of the simplistic examples. I am ready to jump
head first.
Since we are talking generic, textbook type of programs, they will
have to be GUI-less.
-Ramon
ps: Windows-specific code need not apply.

Bad initialization example in standard?
&nbsp(112 Views)
In 12.6.1 of n2521, it says:
"When an aggregate (whether class or array) contains
members of class type and is initialized by a brace-
enclosed initializer list, each such member is
copy-initialized by the corresponding assignment-expression."
Then the example is given:
complex v[6] = { 1, complex(1,2), complex(), 2 };
where 'complex' is a small class defined in the 12.6
for exemplary purposes.
According to the above paragraph, v[1] should be
copy-constructed from the temporary complex(1,2).
However, the explanation of the example code says:
"complex::complex(double,double) is called for the
initialization of v[1]".
That is, it says that v[1] is directly constructed with
arguments 1,2, and no copy constructor is involved.
Is the example rationale wrong, or have I misinterpreted
the paragraph quoted above

include paths - is there a defacto standard?
&nbsp(193 Views)
The standard doesn't define this but what conventions do projects use
As I understand it,
#include
is used for including system headers and those of frameworks such
as wxWidgets - and
#include "someheader.h"
is used for more application-specific things.
The VC8 docs say, #include searches the paths set for the
project, but #include "..." tries the dir of the file with the include,
and the file that included it etc... before it searches the project
setting include paths.
Is this a defacto standard, or do compilers implement different
ways of doing it Is there a sort of minimal conventions programmers
stick to to be compiler-independent

How to tell if standard input is UNICODE or ANSI text ?
&nbsp(126 Views)
Sorry if asking a known question.
I have a program that reads lines of text from standard input and
writes the non-empty ones back to standard output.
In most cases it will be used with standard input and output streams
redirected to FS files.
If my input is wide-character (UNICODE) I would like to use wcin and
wcout and write wide-character text to standard output. If my input is
narrow-character I would like to use cin and cout to write narrow-
character text to standard output.
How can I tell if my standard input stream has UNICODE text
Thank you,
Timothy Madden,
Romania

standard
&nbsp(113 Views)
Wade Ward wrote:
> Is there a c++ standard available free of charge
>
No, at least if you're referring to *the* C++ standard.
You can purchase a PDF from ISO (ISO 14882:2003), or you can buy dead
trees http://www.amazon.com/C%2B%2B-Standa.../dp/0470846747