Teamcenter C++ API Reference  2312
TcBaseUtils.hxx
Go to the documentation of this file.
1 // ==================================================
2 // Copyright 2013.
3 // Siemens Product Lifecycle Management Software Inc.
4 // All Rights Reserved.
5 // ==================================================
6 
13 #ifndef TEAMCENTER_BASE_UTILS_TC_BASE_UTILS_HXX
14 #define TEAMCENTER_BASE_UTILS_TC_BASE_UTILS_HXX
15 
16 #include <algorithm>
17 #include <iterator>
18 
19 #include <base_utils/libbase_utils_exports.h>
20 
21 namespace Teamcenter
22 {
23  namespace Util
24  {
39  template< typename Container, typename Vector >
40  void copyBack(
41  const Container& container,
42  Vector& vector
43  )
44  {
45  vector.reserve( vector.size() + container.size() );
46  std::copy( container.begin(), container.end(), std::back_inserter( vector ) );
47  }
48 
61  template< typename T >
62  T array_length( size_t s )
63  {
64  return static_cast<T>(s);
65  }
66  }
67 }
68 
69 #include <base_utils/libbase_utils_undef.h>
70 #endif