Author Joshua.J.Cogliati
Recipients Arfrever, Joshua.J.Cogliati, Vitor.de.Lima, gustavotemple, jrincayc, lbianc, python-dev, vstinner
Date 2015-03-16.14:11:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426515088.4.0.306572134759.issue23644@psf.upfronthosting.co.za>
In-reply-to
Content
>> using namespace std;

>Doing this in a header is ugly.

If you put it in the:
#ifdef __cplusplus
extern "C" {
#endif

then it would only apply till the end of the pyatomic header, and not to anything that includes it.  Something like:

#ifdef __cplusplus
extern "C" {
#if defined(HAVE_STD_ATOMIC)
using namespace std;
#endif
#endif

But if you are already defining:
#define _Atomic(T) atomic<T>
maybe it should be:
#define _Atomic(T) std::atomic<T>

(I haven't checked any of this code, but they would get around the namespace std being changed in code that includes pyatomic.h problem. )
History
Date User Action Args
2015-03-16 14:11:28Joshua.J.Cogliatisetrecipients: + Joshua.J.Cogliati, vstinner, Arfrever, jrincayc, python-dev, Vitor.de.Lima, gustavotemple, lbianc
2015-03-16 14:11:28Joshua.J.Cogliatisetmessageid: <1426515088.4.0.306572134759.issue23644@psf.upfronthosting.co.za>
2015-03-16 14:11:28Joshua.J.Cogliatilinkissue23644 messages
2015-03-16 14:11:28Joshua.J.Cogliaticreate