Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:58

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/util/same_instance.hpp
0004 
0005  [begin_description]
0006  Basic check if two variables are the same instance
0007  [end_description]
0008 
0009  Copyright 2012 Karsten Ahnert
0010  Copyright 2012 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
0015  */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED
0020 
0021 namespace boost {
0022 namespace numeric {
0023 namespace odeint {
0024 
0025 template< class T1 , class T2 , class Enabler=void >
0026 struct same_instance_impl
0027 { 
0028     static bool same_instance( const T1& /* x1 */ , const T2& /* x2 */ )
0029     {
0030         return false;
0031     }
0032 };
0033 
0034 template< class T >
0035 struct same_instance_impl< T , T >
0036 { 
0037     static bool same_instance( const T &x1 , const T &x2 )
0038     {
0039         // check pointers
0040         return (&x1 == &x2);
0041     }
0042 };
0043 
0044 
0045 template< class T1 , class T2 >
0046 bool same_instance( const T1 &x1 , const T2 &x2 )
0047 {
0048     return same_instance_impl< T1 , T2 >::same_instance( x1 , x2 );
0049 }
0050 
0051 
0052 } // namespace odeint
0053 } // namespace numeric
0054 } // namespace boost
0055 
0056 #endif