X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a7ece9a7073ae69a657ba432b187a69ef7db23d9..cf0ebedfe4a6fd8a14784135e912725b7e027d6f:/include/xbt/utility.hpp diff --git a/include/xbt/utility.hpp b/include/xbt/utility.hpp index e5776312f2..df3fbf4ccf 100644 --- a/include/xbt/utility.hpp +++ b/include/xbt/utility.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2017. The SimGrid Team. +/* Copyright (c) 2016-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,6 +22,13 @@ public: bool operator()(const Pair& a, const Pair& b) const { return a.first > b.first; } }; +/** @brief Erase an element given by reference from a boost::intrusive::list. + */ +template inline void intrusive_erase(List& list, Elem& elem) +{ + list.erase(list.iterator_to(elem)); +} + // integer_sequence and friends from C++14 // We need them to implement `apply` from C++17.