boost multi_index_container не компилируется

Пытаюсь следовать документам по ускорению по использованию этого, но сталкиваюсь с загвоздкой.

Сборка на CentOS 7, g++ 4.8.5-28. Стандарт языка: C++03

Рабочий образец: https://godbolt.org/z/KPvjS_

Мой код:

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/composite_key.hpp>

using namespace ::boost;
using namespace ::boost::multi_index;

typedef unsigned char UInt8;
typedef unsigned int UInt32;
typedef UInt8 ACCESSID[16];

class AccessID
{
public:
    AccessID();
    AccessID(const AccessID & id);
    const std::size_t GetHash() const { return hashId;}

private:
    ACCESSID id;
    std::size_t hashId;
};

struct map_entry
{
    UInt32          subject_hash;
    UInt32          container;
    AccessID        clientAccessId;
    AccessID        serverAccessId;

    map_entry( UInt32   parmHash
             , UInt32   parmContainer
             , AccessID &parmClientAccessId
             , AccessID &parmServerAccessId )
        : subject_hash( parmHash )
        , container( parmContainer )
        , clientAccessId( parmClientAccessId )
        , serverAccessId( parmServerAccessId )
    {
    }
};

struct clientAccessId_extractor
{
    typedef std::size_t result_type;
    result_type operator ()( const map_entry &e ) const
    {
        // Hash is a boost::hash value.
        return e.clientAccessId.GetHash();
    }
};

struct serverAccessId_extractor
{
    typedef std::size_t result_type;
    result_type operator ()( const map_entry &e ) const
    {
        return e.serverAccessId.GetHash();
    }
};

// Define the mapping relationships; like a "database" of sorts.
typedef multi_index_container<
    map_entry,
    indexed_by<
        // Former "global" view.
        ordered_unique<
            composite_key<
                map_entry,
                member< map_entry, UInt32, &map_entry::container >,
                serverAccessId_extractor
            >
        >,

        // Regular lookup.
        ordered_unique<
            composite_key<
                map_entry,
                member< map_entry, UInt32, &map_entry::subject_hash >,
                member< map_entry, UInt32, &map_entry::container >,
                clientAccessId_extractor
            >
        >
    >
> mapDb_t;

// Typedef the index types for easier reading.
typedef mapDb_t::nth_index< 0 >::type mapDb_by_serverAid;
typedef mapDb_t::nth_index< 1 >::type mapDb_by_clientAid;

class MappingClass
{
private:

    // Index views.
    mapDb_by_serverAid serverView;
    mapDb_by_clientAid clientView;

    // Index iterators.
    mapDb_by_clientAid::iterator clientIter;
    mapDb_by_serverAid::iterator serverIter;

    // Define an object of the mapping db type.
    mapDb_t mapDb;

public:
    MappingClass() { };
    ~MappingClass() { };
};

И вывод ошибки при попытке компиляции:

$ g++ -fPIC -x c++ -c -Wno-unused-local-typedefs -Wall -Werror -O2 -m64 -D__EXTENSIONS__ -U_RWSTD_MULTI_THREAD -U_REENTRANT -DUSE_PTHREADS -DNDEBUG -DGCCBOOL -U_THREAD_SAFE -I/home/jearle/git//Open-Source/boost/1.51.0/common  test_mi2.cpp -o test_mi2.o
test_mi2.cpp: In constructor ‘MappingClass::MappingClass()’:
test_mi2.cpp:110:20: error: no matching function for call to ‘boost::multi_index::detail::ordered_index<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor>, std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> > >, boost::multi_index::detail::nth_layer<1, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >, boost::mpl::vector0<mpl_::na>, boost::multi_index::detail::ordered_unique_tag>::ordered_index( ’
     MappingClass() { };
                    ^
test_mi2.cpp:110:20: note: candidates are:
In file included from test_mi2.cpp:3:0:
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:542:3: note: boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::ordered_index(const boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>&) [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<1, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag]
   ordered_index(
   ^
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:542:3: note:   candidate expects 1 argument, 0 provided
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:534:3: note: boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::ordered_index(const ctor_args_list&, const allocator_type&) [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<1, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag; boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::ctor_args_list = boost::tuples::cons<boost::tuples::tuple<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor>, std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> > >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, boost::tuples::cons<boost::tuples::tuple<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>, std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, boost::tuples::null_type> >; typename SuperMeta::type::ctor_args_list = boost::tuples::cons<boost::tuples::tuple<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>, std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, boost::tuples::null_type>; boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::allocator_type = std::allocator<map_entry>]
   ordered_index(const ctor_args_list& args_list,const allocator_type& al):
   ^
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:534:3: note:   candidate expects 2 arguments, 0 provided
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:558:3: error: ‘boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::~ordered_index() [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<1, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag]’ is protected
   ~ordered_index()
   ^
test_mi2.cpp:110:20: error: within this context
     MappingClass() { };
                    ^
test_mi2.cpp:110:20: error: no matching function for call to ‘boost::multi_index::detail::ordered_index<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>, std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, boost::multi_index::detail::nth_layer<2, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >, boost::mpl::vector0<mpl_::na>, boost::multi_index::detail::ordered_unique_tag>::ordered_index()’
test_mi2.cpp:110:20: note: candidates are:
In file included from test_mi2.cpp:3:0:
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:542:3: note: boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::ordered_index(const boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>&) [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<2, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag]
   ordered_index(
   ^
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:542:3: note:   candidate expects 1 argument, 0 provided
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:534:3: note: boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::ordered_index(const ctor_args_list&, const allocator_type&) [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<2, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag; boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::ctor_args_list = boost::tuples::cons<boost::tuples::tuple<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>, std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, boost::tuples::null_type>; typename SuperMeta::type::ctor_args_list = boost::tuples::null_type; boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::allocator_type = std::allocator<map_entry>]
   ordered_index(const ctor_args_list& args_list,const allocator_type& al):
   ^
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:534:3: note:   candidate expects 2 arguments, 0 provided
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:558:3: error: ‘boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::~ordered_index() [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<2, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag]’ is protected
   ~ordered_index()
   ^
test_mi2.cpp:110:20: error: within this context
     MappingClass() { };
                    ^
In file included from test_mi2.cpp:3:0:
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp: In destructor ‘MappingClass::~MappingClass()’:
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:558:3: error: ‘boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::~ordered_index() [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<1, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag]’ is protected
   ~ordered_index()
   ^
test_mi2.cpp:111:21: error: within this context
     ~MappingClass() { };
                     ^
In file included from test_mi2.cpp:3:0:
/home/jearle/git//Open-Source/boost/1.51.0/common/boost/multi_index/ordered_index.hpp:558:3: error: ‘boost::multi_index::detail::ordered_index<KeyFromValue, Compare, SuperMeta, TagList, Category>::~ordered_index() [with KeyFromValue = boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor>; Compare = std::less<boost::multi_index::composite_key_result<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >; SuperMeta = boost::multi_index::detail::nth_layer<2, map_entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, serverAccessId_extractor> >, boost::multi_index::ordered_unique<boost::multi_index::composite_key<map_entry, boost::multi_index::member<map_entry, unsigned int, &map_entry::subject_hash>, boost::multi_index::member<map_entry, unsigned int, &map_entry::container>, clientAccessId_extractor> > >, std::allocator<map_entry> >; TagList = boost::mpl::vector0<mpl_::na>; Category = boost::multi_index::detail::ordered_unique_tag]’ is protected
   ~ordered_index()
   ^
test_mi2.cpp:111:21: error: within this context
     ~MappingClass() { };
                     ^

Я действительно не понимаю, что такое ошибки наддува, здесь. Что я пропустил?


person Jon    schedule 15.05.2019    source источник
comment
Не имеет отношения, но почему бы вам не установить devtoolset-8 и получить достаточно современный компилятор (gcc 8.2) с поддержкой C++17 и полной поддержкой вашего дистрибутива? Оставаться с древним стоковым компилятором gcc 4.8 кажется мазохистским упражнением.   -  person Jesper Juhl    schedule 15.05.2019
comment
Опубликуйте минимально воспроизводимый пример, желательно со ссылкой на Godbolt. Ваши номера строк с ошибками даже не совпадают с вашим образцом кода.   -  person xaxxon    schedule 15.05.2019
comment
@JesperJuhl Есть внутренние причины, по которым это компилятор в игре.   -  person Jon    schedule 15.05.2019
comment
@Джон Файн. Я просто пытался указать тебе направление, где меньше боли. ???? И RedHat на самом деле полностью поддерживает связывание объектов, созданных стандартным компилятором, с объектами, созданными с помощью devtoolsetбольшинстве случаев), поэтому вы можете преодолеть некоторые из этих внутренних причин ????   -  person Jesper Juhl    schedule 15.05.2019
comment
@xaxxon Сделано как просили.   -  person Jon    schedule 15.05.2019


Ответы (1)


Типы индексов карты не являются конструктивными по умолчанию, вам нужно изменить их на ссылки и инициализировать их в своем конструкторе:

class MappingClass
{
private:
    // Define an object of the mapping db type.
    mapDb_t mapDb;

    // Index iterators.
    mapDb_by_clientAid::iterator clientIter;
    mapDb_by_serverAid::iterator serverIter;

    // Index views.
    mapDb_by_serverAid& serverView;
    mapDb_by_clientAid& clientView;

public:
    MappingClass()
    :serverView( mapDb.get< 0 >() ),
     clientView( mapDb.get< 1 >() ) { };
    ~MappingClass() { };
};

Обратите внимание, что вам также необходимо переместить mapDb перед представлениями, чтобы он инициализировался первым.

person Alan Birtles    schedule 15.05.2019
comment
Это помогло. На самом деле я размещал создание представления в конструкторе, определенном в моем файле cpp, но закомментировал их из-за всех ошибок, которые я видел. - person Jon; 16.05.2019