Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::Process doesn't work with #define new (boost 1.69)
From: Vivek Subramanian (tzar123_at_[hidden])
Date: 2019-02-12 04:52:32


Well, okay, but Win32 code doesn #undef new at the start, and Microsoft
themselves say to #define new for using CRT!

https://docs.microsoft.com/en-us/visualstudio/debugger/finding-memory-leaks-using-the-crt-library?view=vs-2017

On Tue, Feb 12, 2019 at 12:27 AM Marshall Clow <mclow.lists_at_[hidden]>
wrote:

> On Mon, Feb 11, 2019 at 10:51 AM Vivek Subramanian via Boost-users <
> boost-users_at_[hidden]> wrote:
>
>> Hello,
>> I did #define new for debugging memory leaks, and I get
>> this error:
>>
>>
> Sigh. I would have hoped that your compiler would have rejected the code
> out of hand.
>
> [macro.names]/2:
> A translation unit shall not #define or #undef names lexically identical
> to keywords, to the identifiers listed in Table 4, to the attribute-tokens
> described in 9.11, or to the identifiers expects or ensures, except that
> the names likely and unlikely may be defined as function-like macros (14.3).
>
> 'new' is a keyword listed in Table 4.
>
> -- Marshall
>
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net