/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
/// Synonym for \p cds::intrusive::mspriority_queue::empty_stat
typedef cds::intrusive::mspriority_queue::empty_stat empty_stat;
-
- /// Synonym for \p cds::intrusive::mspriority_queue::monotonic_counter
- typedef cds::intrusive::mspriority_queue::monotonic_counter monotonic_counter;
#else
using cds::intrusive::mspriority_queue::stat;
using cds::intrusive::mspriority_queue::empty_stat;
- using cds::intrusive::mspriority_queue::monotonic_counter;
#endif
/// MSPriorityQueue traits
If the compiler supports move semantics it would be better to specify the move policy
based on the move semantics for type \p T.
- \p opt::stat - internal statistics. Available types: \p mspriority_queue::stat, \p mspriority_queue::empty_stat (the default, no overhead)
- - \p opt::item_counter - an item counter type for \p MSPriorityQueue.
- Available type: \p cds::bitop::bit_reverse_counter, \p mspriority_queue::monotonic_counter. See \p cds::intrusive::mspriority_queue::traits::item_counter for details.
*/
template <typename... Options>
struct make_traits {
typedef typename base_class::lock_type lock_type; ///< heap's size lock type
typedef typename base_class::back_off back_off ; ///< Back-off strategy
typedef typename traits::stat stat; ///< internal statistics type, see \p intrusive::mspriority_queue::traits::stat
- typedef typename traits::item_counter item_counter;///< Item counter type, see \p intrusive::mspriority_queue::traits::item_counter
+ typedef typename base_class::item_counter item_counter;///< Item counter type
typedef typename traits::allocator::template rebind<value_type>::other allocator_type; ///< Value allocator
typedef typename traits::move_policy move_policy; ///< Move policy for type \p T
bool push( value_type const& val )
{
scoped_ptr pVal( cxx_allocator().New( val ));
- if ( base_class::push( *(pVal.get()) )) {
+ if ( base_class::push( *(pVal.get()))) {
pVal.release();
return true;
}
template <typename Func>
bool push_with( Func f )
{
- scoped_ptr pVal( cxx_allocator().New() );
+ scoped_ptr pVal( cxx_allocator().New());
f( *pVal );
if ( base_class::push( *pVal )) {
pVal.release();
bool emplace( Args&&... args )
{
scoped_ptr pVal( cxx_allocator().MoveNew( std::forward<Args>(args)... ));
- if ( base_class::push( *(pVal.get()) )) {
+ if ( base_class::push( *(pVal.get()))) {
pVal.release();
return true;
}