commit b87bb90661097cdefc37e0c697ff0b1907f82b6a Author: Peter Dimov Date: Thu Aug 23 18:47:44 2001 +0000 initial commit [SVN r10915] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e84d7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/ref.html b/ref.html new file mode 100644 index 0000000..13f1d2d --- /dev/null +++ b/ref.html @@ -0,0 +1,177 @@ + + + + + + + Boost: ref.hpp documentation + + + + + + + + +
+ + + + + + + + + +
+ c++boost.gif (8819 bytes) + + + + +

ref.hpp

 1.00.0003 (2001-08-22)
+
 
+ + + + +
+ +

Files

+ + +

Purpose

+ +

+The header boost/ref.hpp defines the class template +boost::reference_wrapper<T> and the two functions boost::ref and +boost::cref that return instances of boost::reference_wrapper<T>. +

+ +

+The purpose of boost::reference_wrapper<T> is to contain a reference to +an object of type T. It is primarily used to "feed" references to +function templates (algorithms) that take their parameter by value. +

+ +

+To support this usage, boost::reference_wrapper<T> provides an implicit +conversion to T &. This usually allows the function templates to +work on references unmodified. +

+ +

+boost::reference_wrapper<T> is CopyConstructible, but it is not +Assignable. +

+ +

+The expression boost::ref(x) returns a boost::reference_wrapper<X>(x) +where X is the type of x. Similarly, boost::cref(x) +returns a boost::reference_wrapper<X const>(x). +

+ +

Interface

+ +

Synopsis

+ +
+namespace boost
+{
+    template<class T> class reference_wrapper;
+    template<class T> reference_wrapper<T> ref(T & t);
+    template<class T> reference_wrapper<T const> cref(T const & t);
+}
+
+ +

reference_wrapper

+ +
+template<class T> class reference_wrapper
+{
+public:
+
+    explicit reference_wrapper(T & t);
+
+    operator T & () const;
+
+    T & get() const;
+};
+
+ +

explicit reference_wrapper(T & t)

+ +

+Effects: Constructs a reference_wrapper object that stores a reference to t. +

+

+Throws: Nothing. +

+ +

operator T & () const

+ +

+Returns: the stored reference. +

+

+Throws: Nothing. +

+ +

T & get() const

+ +

+Returns: the stored reference. +

+

+Throws: Nothing. +

+ +

ref

+ +
+template<class T> reference_wrapper<T> ref(T & t);
+
+ +

+Returns: reference_wrapper<T>(t). +

+

+Throws: Nothing. +

+ +

cref

+ +
+template<class T> reference_wrapper<T const> cref(T const & t);
+
+ +

+Returns: reference_wrapper<T const>(t). +

+

+Throws: Nothing. +

+ +

Acknowledgements

+ +

+ref and cref were originally part of the Boost.Tuple library. +They were "promoted to boost:: status" because they are generally +useful. +

+ + +




Copyright © 2001 by Peter Dimov and Multi Media +Ltd. Permission to copy, use, modify, sell and distribute this document is +granted provided this copyright notice appears in all copies. This document +is provided "as is" without express or implied warranty, and with +no claim as to its suitability for any purpose.

+ +
+ +
+ + +