Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Issue 11411318: DO NOT COMMIT: NullPtr support (Closed)

Created:
8 years ago by Ryan Sleevi
Modified:
7 years, 9 months ago
Reviewers:
awong
Visibility:
Public.

Description

DO NOT COMMIT: NullPtr support BUG=none

Patch Set 1 #

Patch Set 2 : WIP #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -3 lines) Patch
M base/base.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M base/memory/scoped_ptr.h View 1 2 chunks +10 lines, -1 line 0 comments Download
A base/nullptr.h View 1 chunk +39 lines, -0 lines 0 comments Download
A + base/nullptr.cc View 1 chunk +6 lines, -2 lines 0 comments Download
A base/nullptr_unittest.cc View 1 chunk +67 lines, -0 lines 0 comments Download
M build/build_config.h View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Ryan Sleevi
awong: This is FYI as the culmination of the nullptr experiments. What you don't see ...
8 years ago (2012-12-03 17:58:44 UTC) #1
awong
Good news is we can probably use std::nullptr on MSVC given the MSVC 2010 baseline ...
8 years ago (2012-12-04 20:42:44 UTC) #2
Ryan Sleevi
8 years ago (2012-12-05 04:05:32 UTC) #3
awong: More ugly hackiness, but this now disambiguates.

The problem was the compiler trying to determine which overload to call, in the
set of 

scoped_ptr(std::nullptr_t)
scoped_ptr(C*)

When invoked as scoped_ptr(NULL). This is because NULL is treated as the
integral constant 0, which is convertible to both C* and std::nullptr_t

This is, ultimately, a giant hack. We could just as well allow scoped_ptr(int)
and hide scoped_ptr(C*) using similar SFINAE, and avoid the whole base::NullPtr
bruaha.

we'd also have to pull in the tr1::type_traits into our local type traits, this
was just being lazy and showing the PoC.

Powered by Google App Engine
This is Rietveld 408576698