On Sat, 2013-01-19 at 13:24 +0000, Jonathan Wakely wrote: > On Jan 19, 2013 3:22 AM, "Nick" wrote: > > > > When I use a std::unique_ptr w/ a custom deleter via an inline lambda in > > a non-template function implemented inline in a header file, I get a > > linker error. > > The error you're getting is a known bug with lambdas, you can find > multiple issues like it in bugzilla. Thanks for the info Jonathan. I'm a bit surprised I didn't come across these issue via Google searches. I'll look directly in bugzilla. So for clarity, are you saying that this is a known bug w/ gcc's support for lambdas, or something larger (ie. w/ the spec)? > > > Note that the specifics of this example are only for demonstration > > purposes--I'm not actually trying to use a custom deleter to perform > > what the default implementation does. > > It's good that it's only for demonstration because your deleters have > undefined behaviour, they mix the array form of 'new' with the > non-array 'delete'. > > Usually the unique_ptr<T[]> specialization should be used for arrays. Right, thanks.