Patchwork [v3] Change raw_storage_iterator to use __addressof

login
register
mail settings
Submitter Paolo Carlini
Date Sept. 16, 2010, 5:10 p.m.
Message ID <4C924F84.1010001@oracle.com>
Download mbox | patch
Permalink /patch/64984/
State New
Headers show

Comments

Paolo Carlini - Sept. 16, 2010, 5:10 p.m.
Hi,

tested x86_64-linux, committed to mainline.

Paolo.

PS: many thanks to Daniel ;)

////////////////////
2010-09-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_raw_storage_iter.h (raw_storage_iterator<>::
	operator=(const _Tp&)): Use std::__addressof.

Patch

Index: include/bits/stl_raw_storage_iter.h
===================================================================
--- include/bits/stl_raw_storage_iter.h	(revision 164339)
+++ include/bits/stl_raw_storage_iter.h	(working copy)
@@ -1,6 +1,6 @@ 
 // -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -81,7 +81,7 @@ 
       raw_storage_iterator&
       operator=(const _Tp& __element)
       {
-	std::_Construct(&*_M_iter, __element);
+	std::_Construct(std::__addressof(*_M_iter), __element);
 	return *this;
       }