当前位置: 首页>>代码示例>>C++>>正文


C++ table::node_alloc方法代码示例

本文整理汇总了C++中table::node_alloc方法的典型用法代码示例。如果您正苦于以下问题:C++ table::node_alloc方法的具体用法?C++ table::node_alloc怎么用?C++ table::node_alloc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在table的用法示例。


在下文中一共展示了table::node_alloc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: move_assign

        void move_assign(table& x, false_type)
        {
            if (node_alloc() == x.node_alloc()) {
                delete_buckets();
                set_hash_functions new_func_this(*this, x);
                // No throw from here.
                mlf_ = x.mlf_;
                max_load_ = x.max_load_;
                move_buckets_from(x);
                new_func_this.commit();
            }
            else {
                set_hash_functions new_func_this(*this, x);
                new_func_this.commit();
                mlf_ = x.mlf_;
                recalculate_max_load();

                if (!size_ && !x.size_) return;

                if (x.size_ >= max_load_) {
                    create_buckets(min_buckets_for_size(x.size_));
                }
                else {
                    clear_buckets();
                }

                static_cast<table_impl*>(this)->move_assign_buckets(x);
            }
        }
开发者ID:BentSm,项目名称:povray,代码行数:29,代码来源:table.hpp

示例2: assign

        void assign(table const& x, true_type)
        {
            if (node_alloc() == x.node_alloc()) {
                allocators_.assign(x.allocators_);
                assign(x, false_type());
            }
            else {
                set_hash_functions new_func_this(*this, x);

                // Delete everything with current allocators before assigning
                // the new ones.
                delete_buckets();
                allocators_.assign(x.allocators_);

                // Copy over other data, all no throw.
                new_func_this.commit();
                mlf_ = x.mlf_;
                bucket_count_ = min_buckets_for_size(x.size_);
                max_load_ = 0;

                // Finally copy the elements.
                if (x.size_) {
                    static_cast<table_impl*>(this)->copy_buckets(x);
                }
            }
        }
开发者ID:BentSm,项目名称:povray,代码行数:26,代码来源:table.hpp

示例3: swap_allocators

        void swap_allocators(table& other, false_type)
        {
            boost::unordered::detail::func::ignore_unused_variable_warning(other);

            // According to 23.2.1.8, if propagate_on_container_swap is
            // false the behaviour is undefined unless the allocators
            // are equal.
            BOOST_ASSERT(node_alloc() == other.node_alloc());
        }
开发者ID:BentSm,项目名称:povray,代码行数:9,代码来源:table.hpp

示例4: move_init

 void move_init(table& x)
 {
     if(node_alloc() == x.node_alloc()) {
         move_buckets_from(x);
     }
     else if(x.size_) {
         // TODO: Could pick new bucket size?
         static_cast<table_impl*>(this)->move_buckets(x);
     }
 }
开发者ID:BentSm,项目名称:povray,代码行数:10,代码来源:table.hpp


注:本文中的table::node_alloc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。