diff options
author | jeanluc@chromium.org <jeanluc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-30 22:57:35 +0000 |
---|---|---|
committer | jeanluc@chromium.org <jeanluc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-30 22:57:35 +0000 |
commit | 107446884c2e92b17f494ded21b315a052e51928 (patch) | |
tree | 35ff2b61b9a8a4ae0c07bbbb30d1fcb05d364ff7 /chrome/browser/search_engines | |
parent | c90d849636fd9db7f79f2f2b4611f2bcff0c5700 (diff) | |
download | chromium_src-107446884c2e92b17f494ded21b315a052e51928.zip chromium_src-107446884c2e92b17f494ded21b315a052e51928.tar.gz chromium_src-107446884c2e92b17f494ded21b315a052e51928.tar.bz2 |
In Visual Studio 2010, pass a nullptr rather than NULL when building a std::pair. See http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair
BUG=71138
TEST=Successful compile
Review URL: http://codereview.chromium.org/6366023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r-- | chrome/browser/search_engines/template_url_model.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc index a1cfdac..9a7a193 100644 --- a/chrome/browser/search_engines/template_url_model.cc +++ b/chrome/browser/search_engines/template_url_model.cc @@ -246,6 +246,15 @@ void TemplateURLModel::FindMatchingKeywords( DCHECK(matches != NULL); DCHECK(matches->empty()); // The code for exact matches assumes this. + // Visual Studio 2010 has problems converting NULL to the null pointer for + // std::pair. See http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair + // It will work if we pass nullptr. +#if defined(_MSC_VER) && _MSC_VER >= 1600 + const TemplateURL* null_url = nullptr; +#else + const TemplateURL* null_url = NULL; +#endif + // Find matching keyword range. Searches the element map for keywords // beginning with |prefix| and stores the endpoints of the resulting set in // |match_range|. @@ -253,7 +262,8 @@ void TemplateURLModel::FindMatchingKeywords( KeywordToTemplateMap::const_iterator> match_range( std::equal_range( keyword_to_template_map_.begin(), keyword_to_template_map_.end(), - KeywordToTemplateMap::value_type(prefix, NULL), LessWithPrefix())); + KeywordToTemplateMap::value_type(prefix, null_url), + LessWithPrefix())); // Return vector of matching keywords. for (KeywordToTemplateMap::const_iterator i(match_range.first); |