本文整理汇总了C++中container_type::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ container_type::begin方法的具体用法?C++ container_type::begin怎么用?C++ container_type::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类container_type
的用法示例。
在下文中一共展示了container_type::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
virtual ~request_handlers()
{
std::for_each(
boost::make_transform_iterator(request_handlers_.begin(), get_spec()),
boost::make_transform_iterator(request_handlers_.end(), get_spec()),
std::default_delete<request_spec>());
std::for_each(
boost::make_transform_iterator(request_handlers_.begin(), get_handler()),
boost::make_transform_iterator(request_handlers_.end(), get_handler()),
std::default_delete<request_handler>());
}
示例2: create_frequencies
void create_frequencies( double g )
{
boost::mt19937 rng;
boost::cauchy_distribution<> cauchy( 0.0 , g );
boost::variate_generator< boost::mt19937&, boost::cauchy_distribution<> > gen( rng , cauchy );
generate( m_omega.begin() , m_omega.end() , gen );
}
示例3:
inline std::string to_string( const container_type<F>& container, const char* delimeter = "; ") {
std::stringstream ss;
for(auto it = container.begin(); std::next(it)!=container.end(); ++it)
ss << *it << delimeter;
ss << container.back();
return ss.str();
}
示例4:
static inline void build_half_hull(container_type const& input,
container_type& output,
point_type const& left, point_type const& right)
{
output.push_back(left);
for(iterator it = input.begin(); it != input.end(); ++it)
{
add_to_hull<Factor>(*it, output);
}
add_to_hull<Factor>(right, output);
}
示例5: end
request_handler *find(std::string const &request)
{
auto end(boost::make_transform_iterator(request_handlers_.end(), get_spec()));
auto found_spec(
std::find_if(
boost::make_transform_iterator(request_handlers_.begin(), get_spec()),
end,
spec_conformed(request)));
if (found_spec == end) return 0;
auto found_pair(found_spec.base());
return found_pair->second;
}
示例6: p
std::vector<std::string> create_paths( const std::string& directory, const container_type<std::string>& file_names, const std::string& suffix=".txt" ) {
std::vector<std::string> ret;
for( auto it=file_names.begin(); it!=file_names.end(); ++it) {
std::stringstream ss;
ss << directory << "/" << *it << suffix;
bfs::path p( ss.str());
p = bfs::absolute(p);
p.make_preferred();
ret.push_back( p.string());
}
return ret;
}
示例7: handler_clear_backup
void handler_clear_backup(container_type& cont) const
{
typedef typename container_type::iterator iter_type;
for(iter_type i = cont.begin(), isize = cont.end(); i != isize; ++i)
{
if(i->second)
{
i->second->close();
}
}
cont.clear();
}
示例8: ita
AsynchronousBufferReaderList(
in_iterator_type ina,
in_iterator_type ine,
uint64_t rnumbuffers = 16,
uint64_t rbufsize = 32,
uint64_t offset = 0)
:
C(ina,ine), ita(C.begin()), ite(C.end()), numbuffers(rnumbuffers), bufsize(rbufsize)
{
while ( ita != ite && offset >= getFileSize(*ita) )
{
offset -= getFileSize(*ita);
ita++;
}
if ( ita != ite )
{
reader = UNIQUE_PTR_MOVE(reader_ptr_type(new AsynchronousBufferReader(*ita, numbuffers,bufsize,offset)));
}
}
示例9: begin
static const_iterator begin(const container_type& p) { return p.begin(); }
示例10: hit_test
bool hit_test(value_type x,value_type y, double) const
{
return point_inside_path(x,y,cont_.begin(),cont_.end());
}
示例11: handle
static typename result_of::const_handle_type<container_type, iterator_handle_tag>::type handle( container_type const & container, value_type const & value )
{
for (typename container_type::const_iterator it = container.begin(); it != container.end(); ++it)
if ( &(*it) == &value ) return it;
return container.end();
}
示例12: begin
iterator begin() const
{
return cont_.begin();
}
示例13: begin
iterator begin() {
return container_.begin();
}
示例14: begin
iterator begin() { return values.begin(); }
示例15: insert
iterator insert(iterator pos, Iter first, Iter last) {
//TODO: when GCC has fixed insert just directly return it's value
auto dist=std::distance(begin(), pos);
values.insert(pos, first, last);
return values.begin() + dist;
}