Project

General

Profile

std::any with wt4 build

Added by Derek Spenser over 6 years ago

Attempting to compile wt4 as configured:

cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=~/wt4/ -DCMAKE_CXX_STANDARD=17 -DWT_ASIO_IMPLEMENTATION=standalone -DCMAKE_CXX_STANDARD_REQUIRED=ON -DWT_CPP17_ANY_IMPLEMENTATION=std

yields the compilation error:

...../wt/src/Wt/WAbstractItemView.C:1042:10: error: ‘using any = class std::any {aka class std::any}’ has no member named ‘empty’

consulting the docs for std::any I'm not able to locate an "empty" function, but the inversely equivalent "has_value" function is documented.

altering any reference in Wt4's source from std::any.empty() to std::any.has_value() (with the appropriate contextual logic), Wt4 will compile without error.

I'm just trying to figure out what I'm doing wrong; I don't think that altering the source is the preferred solution. Is there a configuration flag I'm missing? a macro somwhere? What is the proper way to utilize std::any with Wt4? Any help or guidance would be appreciated.

Environment:

git status:
    On branch wt4
    Your branch is up-to-date with 'origin/wt4'.

    nothing to commit, working tree clean

uname -a
    Linux archer 4.13.3-1-ARCH #1 SMP PREEMPT Thu Sep 21 20:33:16 CEST 2017 x86_64 GNU/Linux


gcc --version
    gcc (GCC) 7.2.0
    Copyright (C) 2017 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



cmake --version
    cmake version 3.9.3

    CMake suite maintained and supported by Kitware (kitware.com/cmake).