| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 | #include </Users/christopher/Development/boost/reference_wrapper/ref.hpp>
|
|---|
| 5 |
|
|---|
| 6 | #include <string>
|
|---|
| 7 |
|
|---|
| 8 | using namespace boost ;
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | struct Base
|
|---|
| 13 | { } ;
|
|---|
| 14 |
|
|---|
| 15 | struct Derived
|
|---|
| 16 | : public Base
|
|---|
| 17 | { } ;
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | void someLibraryFunction ( int arg1 , double arg2 , std::string const& arg3 , reference_wrapper<std::string> arg4 , Base const& arg5 , reference_wrapper<Base> arg6 ) { }
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | struct Tester
|
|---|
| 28 | {
|
|---|
| 29 | Tester ()
|
|---|
| 30 | {
|
|---|
| 31 |
|
|---|
| 32 | Derived derived ;
|
|---|
| 33 | std::string string ;
|
|---|
| 34 |
|
|---|
| 35 | reference_wrapper<Derived> d = boost::ref(derived) ;
|
|---|
| 36 | reference_wrapper<Base> b = d ;
|
|---|
| 37 | Base & bb = d ;
|
|---|
| 38 | Base const& bbb = d ;
|
|---|
| 39 |
|
|---|
| 40 | someLibraryFunction ( 42 , 3.14 , "Hello, world" , boost::ref(string) , derived , boost::ref(derived) ) ;
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | }
|
|---|
| 44 | } sTester ;
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|