Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::Process doesn't work with #define new (boost 1.69)
From: Gavin Lambert (boost_at_[hidden])
Date: 2019-02-12 05:16:56

On 12/02/2019 17:52, Vivek Subramanian wrote:
> Well, okay, but Win32 code doesn #undef new at the start, and Microsoft
> themselves say to #define new for using CRT!

Actually, no, they don't -- at least not on that page. (In fact it
specifically un-recommends that.)

The technique shown there is to define a DBG_NEW macro. You then
replace "new" with "DBG_NEW" whenever it appears in your application
code. Hopefully this included the source of the leak.

(You're doing this manually or via find/replace, not by #define new

It is true that in the past (and with MFC) they did recommend redefining
new, but that has caveats. To minimise problems you were always
supposed to do it only after all #includes, as I said in my other reply.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at