mardi 5 septembre 2017

Why is there an error message when splicing list elements from lists with different allocators? And how can this be fixed?

Hello I'm trying to transfer/move an element from one list (in the example foo) at end() to another list (in the example called bar) to position begin().

The only problem is that one of the lists is using an custom made allocator. Which probably results to the following error message:

../src/TestAllocator.cpp:120:28: error: 
no matching function for call to
‘std::list<int>::splice  (  std::_List_iterator<int>&, 
                            std::list<int, CustomAllocator<int> >&, 
                            std::_List_iterator<int>&)’

Code on Coliru

My Question here is:

Why is there an error message when splicing list elements from lists with different allocators?

And how can this be fixed?

Aucun commentaire:

Enregistrer un commentaire