Changeset 1910

Show
Ignore:
Timestamp:
04/02/08 12:21:50 (8 months ago)
Author:
peter
Message:

source/container_classes.h:

Another rewrite of INSTANTIATE_MULTI_ARR with the following goals:

  • Make the instantiation extern on all platforms that support it. This avoids code bloat.
  • Only instantiate methods that are useful in the debugging process.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/container_classes.h

    r1907 r1910  
    17071707typedef multi_arr<double,6>::const_iterator md6ci; 
    17081708 
    1709 #if defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__) 
    1710 #define MAC_EXTERN EXTERN 
     1709#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(_MSC_VER) || defined(__PGI) 
     1710#define INST_EXTERN EXTERN 
    17111711#else 
    1712 #define MAC_EXTERN 
    1713 #endif 
    1714  
    1715 // on Mac these instantiations need to be extern in order to avoid duplicate symbols 
    1716 // but MS Visual Studio rejects the extern declaration as a syntax error.... 
     1712#define INST_EXTERN 
     1713#endif 
     1714 
     1715// on Mac systems these instantiations need to be extern in order to avoid duplicate symbols 
    17171716#define INSTANTIATE_MULTI_ARR( TYPE, LAYOUT, BC ) \ 
    1718 MAC_EXTERN template TYPE& n_pointer<TYPE,1,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1719 MAC_EXTERN template const n_pointer<TYPE,1,LAYOUT,BC> n_pointer<TYPE,2,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1720 MAC_EXTERN template const n_pointer<TYPE,2,LAYOUT,BC> n_pointer<TYPE,3,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1721 MAC_EXTERN template const n_pointer<TYPE,3,LAYOUT,BC> n_pointer<TYPE,4,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1722 MAC_EXTERN template const n_pointer<TYPE,4,LAYOUT,BC> n_pointer<TYPE,5,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1723 MAC_EXTERN template const n_pointer<TYPE,1,LAYOUT,BC> multi_arr<TYPE,2,LAYOUT,BC>::operator[] (const size_t); \ 
    1724 MAC_EXTERN template const n_pointer<TYPE,2,LAYOUT,BC> multi_arr<TYPE,3,LAYOUT,BC>::operator[] (const size_t); \ 
    1725 MAC_EXTERN template const n_pointer<TYPE,3,LAYOUT,BC> multi_arr<TYPE,4,LAYOUT,BC>::operator[] (const size_t); \ 
    1726 MAC_EXTERN template const n_pointer<TYPE,4,LAYOUT,BC> multi_arr<TYPE,5,LAYOUT,BC>::operator[] (const size_t); \ 
    1727 MAC_EXTERN template const n_pointer<TYPE,5,LAYOUT,BC> multi_arr<TYPE,6,LAYOUT,BC>::operator[] (const size_t); \ 
    1728 MAC_EXTERN template const TYPE& const_n_pointer<TYPE,1,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1729 MAC_EXTERN template const const_n_pointer<TYPE,1,LAYOUT,BC> const_n_pointer<TYPE,2,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1730 MAC_EXTERN template const const_n_pointer<TYPE,2,LAYOUT,BC> const_n_pointer<TYPE,3,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1731 MAC_EXTERN template const const_n_pointer<TYPE,3,LAYOUT,BC> const_n_pointer<TYPE,4,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1732 MAC_EXTERN template const const_n_pointer<TYPE,4,LAYOUT,BC> const_n_pointer<TYPE,5,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1733 MAC_EXTERN template const const_n_pointer<TYPE,1,LAYOUT,BC> multi_arr<TYPE,2,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1734 MAC_EXTERN template const const_n_pointer<TYPE,2,LAYOUT,BC> multi_arr<TYPE,3,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1735 MAC_EXTERN template const const_n_pointer<TYPE,3,LAYOUT,BC> multi_arr<TYPE,4,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1736 MAC_EXTERN template const const_n_pointer<TYPE,4,LAYOUT,BC> multi_arr<TYPE,5,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1737 MAC_EXTERN template const const_n_pointer<TYPE,5,LAYOUT,BC> multi_arr<TYPE,6,LAYOUT,BC>::operator[] (const size_t) const; \ 
    1738 MAC_EXTERN template TYPE& basic_pntr<TYPE,2,LAYOUT,BC>::operator* () const; \ 
    1739 MAC_EXTERN template TYPE& basic_pntr<TYPE,3,LAYOUT,BC>::operator* () const; \ 
    1740 MAC_EXTERN template TYPE& basic_pntr<TYPE,4,LAYOUT,BC>::operator* () const; \ 
    1741 MAC_EXTERN template TYPE& basic_pntr<TYPE,5,LAYOUT,BC>::operator* () const; \ 
    1742 MAC_EXTERN template TYPE& basic_pntr<TYPE,6,LAYOUT,BC>::operator* () const 
     1717INST_EXTERN template class pntr<TYPE,2,LAYOUT,BC>; \ 
     1718INST_EXTERN template class pntr<TYPE,3,LAYOUT,BC>; \ 
     1719INST_EXTERN template class pntr<TYPE,4,LAYOUT,BC>; \ 
     1720INST_EXTERN template class pntr<TYPE,5,LAYOUT,BC>; \ 
     1721INST_EXTERN template class pntr<TYPE,6,LAYOUT,BC>; \ 
     1722INST_EXTERN template class const_pntr<TYPE,2,LAYOUT,BC>; \ 
     1723INST_EXTERN template class const_pntr<TYPE,3,LAYOUT,BC>; \ 
     1724INST_EXTERN template class const_pntr<TYPE,4,LAYOUT,BC>; \ 
     1725INST_EXTERN template class const_pntr<TYPE,5,LAYOUT,BC>; \ 
     1726INST_EXTERN template class const_pntr<TYPE,6,LAYOUT,BC> 
    17431727 
    17441728INSTANTIATE_MULTI_ARR( bool, MEM_LAYOUT_VAL, lgBOUNDSCHECKVAL );