inline T read_int(InIterator& start, bool advance=true, std::size_t bytesize=sizeof(T)) { BOOST_STATIC_ASSERT(boost::is_float<T>::value||boost::is_integral<T>::value); return read_value<T>(start,advance,bytesize); }
static block_type encypher_block(schedule_type const &schedule, block_type const &plaintext) { #ifdef BOOST_HASH_SHOW_PROGRESS for (unsigned t = 0; t < block_words; ++t) { std::printf(word_bits == 32 ? "H[%d] = %.8x\n" : "H[%d] = %.16lx\n", t, plaintext[t]); } #endif // Initialize working variables with block word_type a = plaintext[0], b = plaintext[1], c = plaintext[2], d = plaintext[3], e = plaintext[4], f = plaintext[5], g = plaintext[6], h = plaintext[7]; // Encypher block #ifdef BOOST_HASH_NO_OPTIMIZATION for (unsigned t = 0; t < rounds; ++t) { word_type T1 = h + policy_type::Sigma_1(e) + policy_type::Ch(e, f, g) + policy_type::constant(t) + schedule[t]; word_type T2 = policy_type::Sigma_0(a) + policy_type::Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; #ifdef BOOST_HASH_SHOW_PROGRESS std::printf(word_bits == 32 ? "t = %2d: %.8x %.8x %.8x %.8x" " %.8x %.8x %.8x %.8x\n" : "t = %2d: %.16lx %.16lx %.16lx %.16lx" " %.16lx %.16lx %.16lx %.16lx\n", t, a, b, c, d, e, f, g, h); #endif } #else // BOOST_HASH_NO_OPTIMIZATION BOOST_STATIC_ASSERT(rounds % block_words == 0); for (unsigned t = 0; t < rounds; ) { for (int n = block_words; n--; ++t) { word_type T1 = h + policy_type::Sigma_1(e) + policy_type::Ch(e, f, g) + policy_type::constant(t) + schedule[t]; word_type T2 = policy_type::Sigma_0(a) + policy_type::Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; #ifdef BOOST_HASH_SHOW_PROGRESS std::printf(word_bits == 32 ? "t = %2d: %.8x %.8x %.8x %.8x" " %.8x %.8x %.8x %.8x\n" : "t = %2d: %.16lx %.16lx %.16lx %.16lx" " %.16lx %.16lx %.16lx %.16lx\n", t, a, b, c, d, e, f, g, h); #endif } } #endif block_type cyphertext = {{a, b, c, d, e, f, g, h}}; return cyphertext; }
const Value& a() const { BOOST_STATIC_ASSERT(channels_ >= 4); return v_[3]; }
inline typename action_subject<ActionT>::type const & get_action_subject(ActionT const &action_) { BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser<ActionT>::value); return action_.subject(); }
bool is_linked() const { //is_linked() can be only used in safe-mode or auto-unlink BOOST_STATIC_ASSERT(( boost_intrusive_tags::safemode_or_autounlink )); return !node_algorithms::unique(this->this_ptr()); }
inline CoordinateType const& get() const { BOOST_STATIC_ASSERT(K < DimensionCount); return m_values[K]; }
inline typename unary_subject<UnaryT>::type const & get_unary_subject(UnaryT const &unary_) { BOOST_STATIC_ASSERT(::boost::spirit::is_unary_composite<UnaryT>::value); return unary_.subject(); }
atomic(T a = 0): m_value(a) { // For now we just support 32bit signed and unsigned ints BOOST_STATIC_ASSERT(sizeof(T) == 4); }
LRESULT PublicHubsFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP); ctrlStatus.Attach(m_hWndStatusBar); int w[3] = { 0, 0, 0 }; ctrlStatus.SetParts(3, w); m_ctrlHubs.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS, // https://github.com/pavel-pimenov/flylinkdc-r5xx/issues/1611 WS_EX_CLIENTEDGE, IDC_HUBLIST); SET_EXTENDENT_LIST_VIEW_STYLE(m_ctrlHubs); // Create listview columns WinUtil::splitTokens(columnIndexes, SETTING(PUBLICHUBSFRAME_ORDER), COLUMN_LAST); WinUtil::splitTokensWidth(columnSizes, SETTING(PUBLICHUBSFRAME_WIDTHS), COLUMN_LAST); BOOST_STATIC_ASSERT(_countof(columnSizes) == COLUMN_LAST); BOOST_STATIC_ASSERT(_countof(columnNames) == COLUMN_LAST); for (int j = 0; j < COLUMN_LAST; j++) { const int fmt = (j == COLUMN_USERS) ? LVCFMT_RIGHT : LVCFMT_LEFT; m_ctrlHubs.InsertColumn(j, CTSTRING_I(columnNames[j]), fmt, columnSizes[j], j); } m_ctrlHubs.SetColumnOrderArray(COLUMN_LAST, columnIndexes); SET_LIST_COLOR(m_ctrlHubs); m_ctrlHubs.SetImageList(g_flagImage.getIconList(), LVSIL_SMALL); /* extern HIconWrapper g_hOfflineIco; extern HIconWrapper g_hOnlineIco; m_onlineStatusImg.Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 2); m_onlineStatusImg.AddIcon(g_hOnlineIco); m_onlineStatusImg.AddIcon(g_hOfflineIco); m_ctrlHubs.SetImageList(m_onlineStatusImg, LVSIL_SMALL); */ ClientManager::getOnlineClients(m_onlineHubs); m_ctrlHubs.SetFocus(); m_ctrlTree.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP, WS_EX_CLIENTEDGE, IDC_ISP_TREE); m_ctrlTree.SetBkColor(Colors::g_bgColor); m_ctrlTree.SetTextColor(Colors::g_textColor); WinUtil::SetWindowThemeExplorer(m_ctrlTree.m_hWnd); m_treeContainer.SubclassWindow(m_ctrlTree); SetSplitterExtendedStyle(SPLIT_PROPORTIONAL); // При изменении размеров окна-контейнера размеры разделяемых областей меняются пропорционально. SetSplitterPanes(m_ctrlTree.m_hWnd, m_ctrlHubs.m_hWnd); m_nProportionalPos = SETTING(FLYSERVER_HUBLIST_SPLIT); ctrlConfigure.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_PUB_LIST_CONFIG); ctrlConfigure.SetWindowText(CTSTRING(CONFIGURE)); ctrlConfigure.SetFont(Fonts::g_systemFont); ctrlFilter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ES_AUTOHSCROLL, WS_EX_CLIENTEDGE); m_filterContainer.SubclassWindow(ctrlFilter.m_hWnd); ctrlFilter.SetFont(Fonts::g_systemFont); ctrlFilterSel.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | CBS_DROPDOWNLIST, WS_EX_CLIENTEDGE); ctrlFilterSel.SetFont(Fonts::g_systemFont, FALSE); //populate the filter list with the column names for (int j = 0; j < COLUMN_LAST; j++) { ctrlFilterSel.AddString(CTSTRING_I(columnNames[j])); } ctrlFilterSel.AddString(CTSTRING(ANY)); ctrlFilterSel.SetCurSel(COLUMN_LAST); ctrlFilterDesc.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_GROUPBOX, WS_EX_TRANSPARENT); ctrlFilterDesc.SetWindowText(CTSTRING(FILTER)); ctrlFilterDesc.SetFont(Fonts::g_systemFont); SettingsManager::getInstance()->addListener(this); updateList(); loadISPHubs(); m_ctrlHubs.setSort(COLUMN_USERS, ExListViewCtrl::SORT_INT, false); /* const int l_sort = SETTING(HUBS_PUBLIC_COLUMNS_SORT); int l_sort_type = ExListViewCtrl::SORT_STRING_NOCASE; if (l_sort == 2 || l_sort > 4) l_sort_type = ExListViewCtrl::SORT_INT; if (l_sort == 5) l_sort_type = ExListViewCtrl::SORT_BYTES; m_ctrlHubs.setSort(SETTING(HUBS_PUBLIC_COLUMNS_SORT), l_sort_type, BOOLSETTING(HUBS_PUBLIC_COLUMNS_SORT_ASC)); */ hubsMenu.CreatePopupMenu(); hubsMenu.AppendMenu(MF_STRING, IDC_CONNECT, CTSTRING(CONNECT)); hubsMenu.AppendMenu(MF_STRING, IDC_ADD, CTSTRING(ADD_TO_FAVORITES_HUBS)); hubsMenu.AppendMenu(MF_STRING, IDC_REM_AS_FAVORITE, CTSTRING(REMOVE_FROM_FAVORITES_HUBS)); hubsMenu.AppendMenu(MF_STRING, IDC_COPY_HUB, CTSTRING(COPY_HUB)); hubsMenu.SetMenuDefaultItem(IDC_CONNECT); bHandled = FALSE; return TRUE; }
operator D3DXVECTOR2 *() { BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value)); return reinterpret_cast<D3DXVECTOR2 *>(this); }
Vector2dC(const D3DXVECTOR2 &src) { BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value)); set(src.x, src.y); }
operator const D3DXVECTOR2 &() const { BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value)); return *reinterpret_cast<const D3DXVECTOR2 *>(this); }
static void check_gray() { BOOST_STATIC_ASSERT((is_same<typename Layout::color_space_t, gray_t>::value)); }
inline void write_int(T val, OutIterator& start,bool advance=true,std::size_t bytesize=sizeof(T)) { BOOST_STATIC_ASSERT(boost::is_float<T>::value||boost::is_integral<T>::value); return write_value<T>(val,start,advance,bytesize); }
void flush(Device& dev) { BOOST_STATIC_ASSERT(is_filter<T>::value); return iostreams::flush(t_, dev); }
inline void png_read_view(const char* filename,const View& view) { BOOST_STATIC_ASSERT(png_read_support<View>::is_supported); detail::png_reader m(filename); m.apply(view); }
inline void test_no_cv() { typedef BOOST_DEDUCED_TYPENAME boost::promote<T>::type promoted; BOOST_STATIC_ASSERT(( boost::is_same<promoted,Promoted>::value )); }
inline void png_read_image(const char* filename,Image& im) { BOOST_STATIC_ASSERT(png_read_support<typename Image::view_t>::is_supported); detail::png_reader m(filename); m.read_image(im); }
inline void set(CoordinateType const& value) { BOOST_STATIC_ASSERT(K < DimensionCount); m_values[K] = value; }
inline uint32_t Write<float>(const float& f) { BOOST_STATIC_ASSERT(sizeof(float)==4); fwrite(&f,4,1,out); return 4; }
inline typename binary_right_subject<BinaryT>::type const & get_binary_right_subject(BinaryT const &binary_) { BOOST_STATIC_ASSERT(::boost::spirit::is_binary_composite<BinaryT>::value); return binary_.right(); }
inline uint32_t Write<double>(const double& f) { BOOST_STATIC_ASSERT(sizeof(double)==8); fwrite(&f,8,1,out); return 8; }
inline typename semantic_action<ActionT>::type const & get_semantic_action(ActionT const &action_) { BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser<ActionT>::value); return action_.predicate(); }
// ----------------------------------------------------------------------------------- uint32_t WriteBinaryMesh(const aiMesh* mesh) { uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AIMESH); len += Write<unsigned int>(mesh->mPrimitiveTypes); len += Write<unsigned int>(mesh->mNumVertices); len += Write<unsigned int>(mesh->mNumFaces); len += Write<unsigned int>(mesh->mNumBones); len += Write<unsigned int>(mesh->mMaterialIndex); // first of all, write bits for all existent vertex components unsigned int c = 0; if (mesh->mVertices) { c |= ASSBIN_MESH_HAS_POSITIONS; } if (mesh->mNormals) { c |= ASSBIN_MESH_HAS_NORMALS; } if (mesh->mTangents && mesh->mBitangents) { c |= ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS; } for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { if (!mesh->mTextureCoords[n]) { break; } c |= ASSBIN_MESH_HAS_TEXCOORD(n); } for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { if (!mesh->mColors[n]) { break; } c |= ASSBIN_MESH_HAS_COLOR(n); } len += Write<unsigned int>(c); aiVector3D minVec, maxVec; if (mesh->mVertices) { if (shortened) { len += WriteBounds(mesh->mVertices,mesh->mNumVertices); } // else write as usual else len += fwrite(mesh->mVertices,1,12*mesh->mNumVertices,out); } if (mesh->mNormals) { if (shortened) { len += WriteBounds(mesh->mNormals,mesh->mNumVertices); } // else write as usual else len += fwrite(mesh->mNormals,1,12*mesh->mNumVertices,out); } if (mesh->mTangents && mesh->mBitangents) { if (shortened) { len += WriteBounds(mesh->mTangents,mesh->mNumVertices); len += WriteBounds(mesh->mBitangents,mesh->mNumVertices); } // else write as usual else { len += fwrite(mesh->mTangents,1,12*mesh->mNumVertices,out); len += fwrite(mesh->mBitangents,1,12*mesh->mNumVertices,out); } } for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { if (!mesh->mColors[n]) break; if (shortened) { len += WriteBounds(mesh->mColors[n],mesh->mNumVertices); } // else write as usual else len += fwrite(mesh->mColors[n],16*mesh->mNumVertices,1,out); } for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { if (!mesh->mTextureCoords[n]) break; // write number of UV components len += Write<unsigned int>(mesh->mNumUVComponents[n]); if (shortened) { len += WriteBounds(mesh->mTextureCoords[n],mesh->mNumVertices); } // else write as usual else len += fwrite(mesh->mTextureCoords[n],12*mesh->mNumVertices,1,out); } // write faces. There are no floating-point calculations involved // in these, so we can write a simple hash over the face data // to the dump file. We generate a single 32 Bit hash for 512 faces // using Assimp's standard hashing function. if (shortened) { unsigned int processed = 0; for (unsigned int job;(job = std::min(mesh->mNumFaces-processed,512u));processed += job) { uint32_t hash = 0; for (unsigned int a = 0; a < job;++a) { const aiFace& f = mesh->mFaces[processed+a]; uint32_t tmp = f.mNumIndices; hash = SuperFastHash(reinterpret_cast<const char*>(&tmp),sizeof tmp,hash); for (unsigned int i = 0; i < f.mNumIndices; ++i) { BOOST_STATIC_ASSERT(AI_MAX_VERTICES <= 0xffffffff); tmp = static_cast<uint32_t>( f.mIndices[i] ); hash = SuperFastHash(reinterpret_cast<const char*>(&tmp),sizeof tmp,hash); } } len += Write<unsigned int>(hash); } } else // else write as usual { // if there are less than 2^16 vertices, we can simply use 16 bit integers ... for (unsigned int i = 0; i < mesh->mNumFaces;++i) { const aiFace& f = mesh->mFaces[i]; BOOST_STATIC_ASSERT(AI_MAX_FACE_INDICES <= 0xffff); len += Write<uint16_t>(f.mNumIndices); for (unsigned int a = 0; a < f.mNumIndices;++a) { if (mesh->mNumVertices < (1u<<16)) { len += Write<uint16_t>(f.mIndices[a]); } else len += Write<unsigned int>(f.mIndices[a]); } } } // write bones if (mesh->mNumBones) { for (unsigned int a = 0; a < mesh->mNumBones;++a) { const aiBone* b = mesh->mBones[a]; len += WriteBinaryBone(b)+8; } } ChangeInteger(old,len); return len; }
void unlink() { BOOST_STATIC_ASSERT(( (int)boost_intrusive_tags::link_mode == (int)auto_unlink )); node_algorithms::unlink(this->this_ptr()); node_algorithms::init(this->this_ptr()); }
void close(BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out) { BOOST_STATIC_ASSERT(is_device<T>::value); iostreams::close(t_, which); }
Color(Value _r, Value _g, Value _b, Value _a ) { BOOST_STATIC_ASSERT(channels_ == 4); this->operator()(_r,_g,_b,_a); }
bool flush() { BOOST_STATIC_ASSERT(is_device<T>::value); return iostreams::flush(t_); }
void a( const Value& _value ) { BOOST_STATIC_ASSERT(channels_ >= 4); v_[3] = _value; }
int vector_test() { typedef std::vector<int> MyStdVector; typedef typename MyBoostVector::value_type IntType; const int max = 100; if(!test_range_insertion<MyBoostVector>()){ return 1; } { BOOST_TRY{ MyBoostVector *boostvector = new MyBoostVector; MyStdVector *stdvector = new MyStdVector; boostvector->resize(100); stdvector->resize(100); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(200); stdvector->resize(200); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(0); stdvector->resize(0); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; for(int i = 0; i < max; ++i){ IntType new_int(i); boostvector->insert(boostvector->end(), boost::move(new_int)); stdvector->insert(stdvector->end(), i); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; } if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; typename MyBoostVector::iterator boostit(boostvector->begin()); typename MyStdVector::iterator stdit(stdvector->begin()); typename MyBoostVector::const_iterator cboostit = boostit; (void)cboostit; ++boostit; ++stdit; boostvector->erase(boostit); stdvector->erase(stdit); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->erase(boostvector->begin()); stdvector->erase(stdvector->begin()); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; { //Initialize values IntType aux_vect[50]; for(int i = 0; i < 50; ++i){ IntType new_int(-1); BOOST_STATIC_ASSERT((boost::container::test::is_copyable<boost::container::test::movable_int>::value == false)); aux_vect[i] = boost::move(new_int); } int aux_vect2[50]; for(int i = 0; i < 50; ++i){ aux_vect2[i] = -1; } typename MyBoostVector::iterator insert_it = boostvector->insert(boostvector->end() ,boost::make_move_iterator(&aux_vect[0]) ,boost::make_move_iterator(aux_vect + 50)); if(std::size_t(std::distance(insert_it, boostvector->end())) != 50) return 1; stdvector->insert(stdvector->end(), aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; for(int i = 0, j = static_cast<int>(boostvector->size()); i < j; ++i){ boostvector->erase(boostvector->begin()); stdvector->erase(stdvector->begin()); } if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; } { boostvector->resize(100); stdvector->resize(100); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; IntType aux_vect[50]; for(int i = 0; i < 50; ++i){ IntType new_int(-i); aux_vect[i] = boost::move(new_int); } int aux_vect2[50]; for(int i = 0; i < 50; ++i){ aux_vect2[i] = -i; } typename MyBoostVector::size_type old_size = boostvector->size(); typename MyBoostVector::iterator insert_it = boostvector->insert(boostvector->begin() + old_size/2 ,boost::make_move_iterator(&aux_vect[0]) ,boost::make_move_iterator(aux_vect + 50)); if(boostvector->begin() + old_size/2 != insert_it) return 1; stdvector->insert(stdvector->begin() + old_size/2, aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; for(int i = 0; i < 50; ++i){ IntType new_int(-i); aux_vect[i] = boost::move(new_int); } for(int i = 0; i < 50; ++i){ aux_vect2[i] = -i; } old_size = boostvector->size(); //Now try with input iterators instead insert_it = boostvector->insert(boostvector->begin() + old_size/2 ,boost::make_move_iterator(make_input_from_forward_iterator(&aux_vect[0])) ,boost::make_move_iterator(make_input_from_forward_iterator(aux_vect + 50)) ); if(boostvector->begin() + old_size/2 != insert_it) return 1; stdvector->insert(stdvector->begin() + old_size/2, aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; } /* //deque has no reserve boostvector->reserve(boostvector->size()*2); stdvector->reserve(stdvector->size()*2); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; */ boostvector->shrink_to_fit(); MyStdVector(*stdvector).swap(*stdvector); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->shrink_to_fit(); MyStdVector(*stdvector).swap(*stdvector); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; { //push_back with not enough capacity IntType push_back_this(1); boostvector->push_back(boost::move(push_back_this)); stdvector->push_back(int(1)); boostvector->push_back(IntType(1)); stdvector->push_back(int(1)); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; } { //test back() const IntType test_this(1); if(test_this != boostvector->back()) return 1; } { //pop_back with enough capacity boostvector->pop_back(); boostvector->pop_back(); stdvector->pop_back(); stdvector->pop_back(); IntType push_back_this(1); boostvector->push_back(boost::move(push_back_this)); stdvector->push_back(int(1)); boostvector->push_back(IntType(1)); stdvector->push_back(int(1)); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; } if(!vector_copyable_only(boostvector, stdvector ,container_detail::bool_<boost::container::test::is_copyable<IntType>::value>())){ return 1; } boostvector->erase(boostvector->begin()); stdvector->erase(stdvector->begin()); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; for(int i = 0; i < max; ++i){ IntType insert_this(i); boostvector->insert(boostvector->begin(), boost::move(insert_this)); stdvector->insert(stdvector->begin(), i); boostvector->insert(boostvector->begin(), IntType(i)); stdvector->insert(stdvector->begin(), int(i)); } if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; //Test insertion from list { std::list<int> l(50, int(1)); typename MyBoostVector::iterator it_insert = boostvector->insert(boostvector->begin(), l.begin(), l.end()); if(boostvector->begin() != it_insert) return 1; stdvector->insert(stdvector->begin(), l.begin(), l.end()); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->assign(l.begin(), l.end()); stdvector->assign(l.begin(), l.end()); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->clear(); stdvector->clear(); boostvector->assign(make_input_from_forward_iterator(l.begin()), make_input_from_forward_iterator(l.end())); stdvector->assign(l.begin(), l.end()); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; } /* deque has no reserve or capacity std::size_t cap = boostvector->capacity(); boostvector->reserve(cap*2); stdvector->reserve(cap*2); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(0); stdvector->resize(0); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(cap*2); stdvector->resize(cap*2); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->clear(); stdvector->clear(); boostvector->shrink_to_fit(); MyStdVector(*stdvector).swap(*stdvector); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(cap*2); stdvector->resize(cap*2); if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; */ delete stdvector; delete boostvector; } BOOST_CATCH(std::exception &ex){ #ifndef BOOST_NO_EXCEPTIONS std::cout << ex.what() << std::endl; #endif return 1; } BOOST_CATCH_END }