By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,332 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,332 IT Pros & Developers. It's quick & easy.

Depending on _XSTRING_ definition

P: n/a
Would it be safe to assume that if a program is including stl's
wstring/string

#ifdef _XSTRING_ will be valid?

or is this STL implementation dependent?

thanks

Nov 16 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
te*******@gmail.com wrote:
Would it be safe to assume that if a program is including stl's
wstring/string

#ifdef _XSTRING_ will be valid?
No.
or is this STL implementation dependent?
The standard does not mention any _XSTRING_ macro.

Best

Kai-Uwe Bux
Nov 16 '06 #2

P: n/a
Thanks for replying,

Is there another way I could test for the existence of
std::string/wstring?

Does the standard mention anything about _STD?

Kai-Uwe Bux wrote:
te*******@gmail.com wrote:
Would it be safe to assume that if a program is including stl's
wstring/string

#ifdef _XSTRING_ will be valid?

No.
or is this STL implementation dependent?

The standard does not mention any _XSTRING_ macro.

Best

Kai-Uwe Bux
Nov 16 '06 #3

P: n/a

testga...@gmail.com skrev:
Kai-Uwe Bux wrote:
te*******@gmail.com wrote:
Would it be safe to assume that if a program is including stl's
wstring/string
>
#ifdef _XSTRING_ will be valid?
No.
or is this STL implementation dependent?
The standard does not mention any _XSTRING_ macro.
[snip]
First - dont toppost.
Is there another way I could test for the existence of
std::string/wstring?
What do you mean?
#include <stringwill provide you with std::string and std::wstring.
If not, you're not having a compliant compiler (stronger wording would
be appropriate!!).

/Peter
>
Does the standard mention anything about _STD?
Nov 16 '06 #4

P: n/a

peter koch wrote:
testga...@gmail.com skrev:
Kai-Uwe Bux wrote:
te*******@gmail.com wrote:
>
Would it be safe to assume that if a program is including stl's
wstring/string

#ifdef _XSTRING_ will be valid?
>
No.
>
or is this STL implementation dependent?
>
The standard does not mention any _XSTRING_ macro.
[snip]
First - dont toppost.
Sorry, first timer

Is there another way I could test for the existence of
std::string/wstring?
What do you mean?
#include <stringwill provide you with std::string and std::wstring.
If not, you're not having a compliant compiler (stronger wording would
be appropriate!!).

/Peter

Does the standard mention anything about _STD?
I want to be able to do the following:

Under Defines.h -

#ifdef _XSTRING_

typedef std::string UNIQUEKEY

#endif

Applications that don't use stl, can still user the Defines.h files
(for other typedefs/defines), those who do use stl will be able to work
with UNIQUEKEY

Hope I was clear this time,
Thanks

Nov 16 '06 #5

P: n/a
testga...@gmail.com wrote:
I want to be able to do the following:

Under Defines.h -

#ifdef _XSTRING_

typedef std::string UNIQUEKEY

#endif

Applications that don't use stl, can still user the Defines.h files
(for other typedefs/defines), those who do use stl will be able to work
with UNIQUEKEY
All standard C++ libraries (and even the Embedded C++ library) have
std::string. If you include <stringbut the user doesn't use
UNIQUEKEY, then std::string will not be used or linked in.

Cheers! --M

Nov 16 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.