On Sep 13, 4:52 am, Stuart Redmann <DerTop...@web.de> wrote:
[snipped original question about calling convention modifiers like
MS's __cdecl in STL code]
On 13 Sep., Ian Collins wrote:
It can't disallow something it knows nothing about. As soon as you
start using compiler specific extensions, your code is no longer
standard C++.
Thanks for the clarification. I guess that this is another item on
MS's list where the product is not standard-conformant.
No, it's perfectly allowed for MS to add non-standard extensions to
the language, particularly if the keep them in the implementation
namespace, as __cdecl is. GCC, for example, provides similar
function via __attribute__. Neither is part of the standard.
It's not quite clear what the function in question is doing, but it
appears you're trying to define a an insertion operator in a
template that uses a funcion that uses __cdecl calling conventions.
Why? What is being accomplished by that? Inherently this code is
doing something platform specific, and is non-portable.
Where is this coding coming from? What's the context?
The __cdecl is the default calling convention. It is there in headers
with some other calling convention.
would fix that.