template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
- iterator it = std::lower_bound( m_List.begin(), m_List.end(), key, find_predicate() );
- if ( it == m_List.end() || key_comparator()( key, it->first ) != 0 ) {
- //value_type newItem( key );
- it = m_List.emplace( it, value_type( std::forward<K>(key), std::move( mapped_type( std::forward<Args>(args)...) )) );
+ value_type val( key_type( std::forward<K>( key )), mapped_type( std::forward<Args>( args )... ));
+ iterator it = std::lower_bound( m_List.begin(), m_List.end(), val.first, find_predicate() );
+ if ( it == m_List.end() || key_comparator()( val.first, it->first ) != 0 ) {
+ it = m_List.emplace( it, std::move( val ));
# if !defined(CDS_STD_LIST_SIZE_CXX11_CONFORM)
++m_nSize;