CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
testSharedPtrConvertible.cc File Reference
#include "CLHEP/Utility/noncopyable.h"
#include "CLHEP/Utility/memory.h"
#include <cassert>
#include <type_traits>

Go to the source code of this file.

Classes

struct  X
 
struct  Y
 
struct  Z
 

Functions

int f (shared_ptr< void const >)
 
int f (shared_ptr< int >)
 
int f (shared_ptr< incomplete >)
 
int g (shared_ptr< X >)
 
int g (shared_ptr< Y >)
 
int g (shared_ptr< incomplete >)
 
int main ()
 

Function Documentation

◆ f() [1/3]

int f ( shared_ptr< incomplete >   )

Definition at line 51 of file testSharedPtrConvertible.cc.

52{ return 3; }

◆ f() [2/3]

int f ( shared_ptr< int >   )

Definition at line 48 of file testSharedPtrConvertible.cc.

49{ return 2; }

◆ f() [3/3]

int f ( shared_ptr< void const >   )

Definition at line 45 of file testSharedPtrConvertible.cc.

46{ return 1; }

Referenced by main().

◆ g() [1/3]

int g ( shared_ptr< incomplete >  )

Definition at line 60 of file testSharedPtrConvertible.cc.

61{ return 6; }

◆ g() [2/3]

◆ g() [3/3]

int g ( shared_ptr< Y )

Definition at line 57 of file testSharedPtrConvertible.cc.

58{ return 5; }

◆ main()

int main ( )

Definition at line 63 of file testSharedPtrConvertible.cc.

64{
66 assert( 1 == f( p1 ) );
67 assert( 1 == f( shared_ptr<double>() ) );
68
70 assert( 4 == g( p2 ) );
71 assert( 4 == g( shared_ptr<Z>() ) );
72
73 return 0;
74}
std::shared_ptr< T > shared_ptr
Definition: memory.h:17
int f(shared_ptr< void const >)
int g(shared_ptr< X >)