net: explicitly include std::array

On boost 1.81 std::array is no longer included by default and
causes a compile error on net_processing.cpp:

macOS with apple clang 14.0:

  CXX      libdogecoin_server_a-net_processing.o
net_processing.cpp:1112:47: error: implicit instantiation of undefined template 'std::array<std::pair<unsigned long long, CNode *>, 2>'
    std::array<std::pair<uint64_t, CNode*>,2> best{{{0, nullptr}, {0, nullptr}}};

debian:exprimental with gcc 12.1:

net_processing.cpp: In function 'void RelayAddress(const CAddress&, bool, CConnman&)':
net_processing.cpp:1112:47: error: variable 'std::array<std::pair<long unsigned int, CNode*>, 2> best' has initializer but incomplete type
 1112 |     std::array<std::pair<uint64_t, CNode*>,2> best{{{0, nullptr}, {0, nullptr}}};
      |

this commit fixes the problem by explicitly including <array>.
This commit is contained in:
Patrick Lodder 2023-02-01 01:01:06 +01:00
parent 4b73ae26b6
commit 5a5f1955f7
No known key found for this signature in database
GPG Key ID: 2D3A345B98D0DC1F

View File

@ -31,6 +31,7 @@
#include "utilstrencodings.h"
#include "validationinterface.h"
#include <array>
#include <boost/thread.hpp>
#if defined(NDEBUG)