Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/multi_index/detail/header_holder.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | c530137014c0 |
children |
rev | line source |
---|---|
Chris@16 | 1 /* Copyright 2003-2008 Joaquin M Lopez Munoz. |
Chris@16 | 2 * Distributed under the Boost Software License, Version 1.0. |
Chris@16 | 3 * (See accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 4 * http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 5 * |
Chris@16 | 6 * See http://www.boost.org/libs/multi_index for library home page. |
Chris@16 | 7 */ |
Chris@16 | 8 |
Chris@16 | 9 #ifndef BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP |
Chris@16 | 10 #define BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP |
Chris@16 | 11 |
Chris@101 | 12 #if defined(_MSC_VER) |
Chris@16 | 13 #pragma once |
Chris@16 | 14 #endif |
Chris@16 | 15 |
Chris@16 | 16 #include <boost/noncopyable.hpp> |
Chris@16 | 17 |
Chris@16 | 18 namespace boost{ |
Chris@16 | 19 |
Chris@16 | 20 namespace multi_index{ |
Chris@16 | 21 |
Chris@16 | 22 namespace detail{ |
Chris@16 | 23 |
Chris@16 | 24 /* A utility class used to hold a pointer to the header node. |
Chris@16 | 25 * The base from member idiom is used because index classes, which are |
Chris@16 | 26 * superclasses of multi_index_container, need this header in construction |
Chris@16 | 27 * time. The allocation is made by the allocator of the multi_index_container |
Chris@16 | 28 * class --hence, this allocator needs also be stored resorting |
Chris@16 | 29 * to the base from member trick. |
Chris@16 | 30 */ |
Chris@16 | 31 |
Chris@16 | 32 template<typename NodeTypePtr,typename Final> |
Chris@16 | 33 struct header_holder:private noncopyable |
Chris@16 | 34 { |
Chris@16 | 35 header_holder():member(final().allocate_node()){} |
Chris@16 | 36 ~header_holder(){final().deallocate_node(&*member);} |
Chris@16 | 37 |
Chris@16 | 38 NodeTypePtr member; |
Chris@16 | 39 |
Chris@16 | 40 private: |
Chris@16 | 41 Final& final(){return *static_cast<Final*>(this);} |
Chris@16 | 42 }; |
Chris@16 | 43 |
Chris@16 | 44 } /* namespace multi_index::detail */ |
Chris@16 | 45 |
Chris@16 | 46 } /* namespace multi_index */ |
Chris@16 | 47 |
Chris@16 | 48 } /* namespace boost */ |
Chris@16 | 49 |
Chris@16 | 50 #endif |