Code Monkey home page Code Monkey logo

zug's Introduction

Github Actions Badge

CodeCov Badge

Sinusoidal Engineering badge

Logotype

zug is a C++ library providing transducers. Transducers are composable sequential transformations independent of the source. They are extremely lightweight, and can be used to express algorithms over pull-based sequences (iterators, files) but also push based sequences (signals, events, asynchronous streams) in a generic way.

  • Documentation (Contents)
  • Code (GitHub)
  • CppCon 2015 Talk: Transducers: from Clojure to C++ (YouTube, Slides)

    This project is part of a long-term vision helping interactive and concurrent C++ programs become easier to write. Help this project's long term sustainability by becoming a patron or buying a sponsorship package: [email protected]

Example

Here xf is a transducer, a transformation over a sequence of integers, resulting in a sequence of strings. Note, however, that this transformation makes no reference to whatever it is transforming. In fact, we can apply it in many ways.

Transforming a range

As a lazy iterator

Generators and sinks

Reads integers from the terminal and outputs back the positive ones.

Transforming cursors

The library is used in Lager, a library implementing the unidirectional data-flow architecture for C++ interactive applications. It is used to treat reactive values as a temporal sequence that can be transformed in arbitrary ways. For example:

Why?

You have learn Sean Parent's lesson: No Raw Loops. Instead of iterating over sequences directly, you use STL algoriths like transform, filter, etc, or even better, the new ranges library.

However, what if you have a sequence that can not be easily or efficiently expressed as an iterator? Then, you may have to reimplement all these algorithms again, on top of whatever sequence abstraction you have invented, for example, see RxCpp... Or you use transducers.

Transducers are generic algorithmic transformations, in a way that is completely agnostic of the actual sequence that is being transformed. As a library author, you can add transducer support for your library, and automatically get access to our wide collection of transducers and allow your users to simply write their own.

Dependencies

This library is written in C++14 and a compliant compiler is necessary. It is continuously tested with Clang 3.8 and GCC 6, but it might work with other compilers and versions.

If compiling with C++14 and using skip, boost variant is required.

For C++17 and above, no external library is necessary and there are no other requirements.

Usage

This is a header only library but to be configured correctly you need to run CMake first:

mkdir -p build && cd build
cmake ..

Or you can just copy the zug subfolder somewhere in your include path.

Development

In order to develop the library, you will need to compile and run the examples, tests and benchmarks. These require some additional tools. The easiest way to install them is by using the Nix package manager. At the root of the repository just type:

nix-shell

This will download all required dependencies and create an isolated environment in which you can use these dependencies, without polluting your system.

Then you can proceed to generate a development project using CMake:

mkdir build && cd build
cmake ..

From then on, one may build and run all tests by doing:

make check

License

Boost logo

This software is licensed under the Boost Software License 1.0.

The full text of the license is can be accessed via this link and is also included in the LICENSE file of this software package.

zug's People

Contributors

artemsarmini avatar arximboldi avatar asa avatar bluesolei avatar cjbussey avatar johnnynator avatar pinotree avatar tusooa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zug's Issues

Adding a "zug_" prefix to target names and some other enhancements

Hello!

I was trying to link zug and Boost.Hana in a project of mine and ran into issues with target names, so I decided to make a fork and add a zug_ prefix to all targets, variables, and functions where one is missing and add a log function which adds a [zug::${PROJECT_NAME}]: prefix to every status message from zug (when CCache has been or hasn't been found and when adding test targets).
I ran the check target (its name is "zug_check" in my fork) and every test is passing.

I also noticed that when I include the sequence header I get an error saying boost::mpl is not present (there has been an issue discussing this, but I don't know if this was fixed), so I was thinking of adding a metafunction that does the same thing in the meta namespace.

Are you interested in a pull requests that do this? If not, I will just keep using my fork and merge from master from time to time to keep things updated, so it's not a problem on my part if you don't want this.
I would like to add a pull request that does this for immer as well if you are interested.

PS: I dig the idea of making C++ more functional and declarative coming from React, so thank you for all the great libraries 😄

Build fails for Visual C++ 2019 (MSVC 19.26.28806.0) in C++latest mode - code uses `std::result_of`

std::result_of is removed in C++ 20 and deprecated in C++ 17.

  C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-fastbuild/bin /Iexternal/boost /Ibazel-out/x64_windows-fastbuild/bin/external/boost /Iexternal/com_github_catchorg_catch2 /Ibazel-out/x64_windows-fastbuild/bin/external/com_github_catchorg_catch2 /Iexternal/bazel_tools /Ibazel-out/x64_windows-fastbuild/bin/external/bazel_tools /Iinclude /Ibazel-out/x64_windows-fastbuild/bin/include /Iexternal/boost /Ibazel-out/x64_windows-fastbuild/bin/external/boost /Iexternal/boost/boost/mpl /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/mpl /Iexternal/boost/boost/move /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/move /Iexternal/boost/boost/assert /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/assert /Iexternal/boost/boost/detail /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/detail /Iexternal/boost/boost/limits /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/limits /Iexternal/boost/boost/static_assert /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/static_assert /Iexternal/boost/boost/preprocessor /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/preprocessor /Iexternal/boost/boost/range /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/range /Iexternal/boost/boost/array /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/array /Iexternal/boost/boost/config /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/config /Iexternal/boost/boost/version /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/version /Iexternal/boost/boost/core /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/core /Iexternal/boost/boost/functional /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/functional /Iexternal/boost/boost/container_hash /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/container_hash /Iexternal/boost/boost/integer /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/integer /Iexternal/boost/boost/cstdint /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/cstdint /Iexternal/boost/boost/type_traits /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/type_traits /Iexternal/boost/boost/swap /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/swap /Iexternal/boost/boost/throw_exception /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/throw_exception /Iexternal/boost/boost/current_function /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/current_function /Iexternal/boost/boost/exception /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/exception /Iexternal/boost/boost/concept_check /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/concept_check /Iexternal/boost/boost/concept /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/concept /Iexternal/boost/boost/concept_archetype /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/concept_archetype /Iexternal/boost/boost/iterator /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/iterator /Iexternal/boost/boost/utility /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/utility /Iexternal/boost/boost/noncopyable /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/noncopyable /Iexternal/boost/boost/optional /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/optional /Iexternal/boost/boost/none /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/none /Iexternal/boost/boost/type /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/type /Iexternal/boost/boost/ref /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/ref /Iexternal/boost/boost/regex /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/regex /Iexternal/boost/boost/predef /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/predef /Iexternal/boost/boost/smart_ptr /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/smart_ptr /Iexternal/boost/boost/align /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/align /Iexternal/boost/boost/scoped_array /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/scoped_array /Iexternal/boost/boost/checked_delete /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/checked_delete /Iexternal/boost/boost/scoped_ptr /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/scoped_ptr /Iexternal/boost/boost/shared_array /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/shared_array /Iexternal/boost/boost/shared_ptr /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/shared_ptr /Iexternal/boost/boost/tuple /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/tuple /Iexternal/boost/boost/variant /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/variant /Iexternal/boost/boost/call_traits /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/call_traits /Iexternal/boost/boost/math /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/math /Iexternal/boost/boost/atomic /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/atomic /Iexternal/boost/boost/fusion /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/fusion /Iexternal/boost/boost/function_types /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/function_types /Iexternal/boost/boost/get_pointer /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/get_pointer /Iexternal/boost/boost/typeof /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/typeof /Iexternal/boost/boost/lambda /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/lambda /Iexternal/boost/boost/mp11 /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/mp11 /Iexternal/boost/boost/type_index /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/type_index /Iexternal/com_github_catchorg_catch2/single_include /Ibazel-out/x64_windows-fastbuild/bin/external/com_github_catchorg_catch2/single_include /DBOOST_FALLTHROUGH /DBOOST_ALL_NO_LIB /DZUG_VARIANT_STD=0 /DZUG_VARIANT_BOOST=1 /DZUG_ENABLE_BOOST=1 /DHAVE_BAZEL_BUILD=1 /DCATCH_CONFIG_MAIN /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" /std:c++latest /Fobazel-out/x64_windows-fastbuild/bin/test/transducer/_objs/transducer_test/transducer.obj /c test/transducer/transducer.cpp
Execution platform: @local_config_platform//:host
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): error C2039: 'result_of': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\string(24): note: see declaration of 'std'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): error C2947: expecting '>' to terminate template-argument-list, found '<'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): error C3203: 'result_of': unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): warning C4346: 'std::is_same<decay<_Ty>::type,decay<unknown-type>::type>::value': dependent name is not a type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): note: prefix with 'typename' to indicate a type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): error C3646: 'WrappedFn': unknown override specifier
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): error C2988: unrecognizable template declaration/definition
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(37): error C2059: syntax error: '('
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(38): error C2143: syntax error: missing ';' before '{'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(38): error C2447: '{': missing function header (old-style formal list?)
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): error C2039: 'result_of': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\string(24): note: see declaration of 'std'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): error C2947: expecting '>' to terminate template-argument-list, found '<'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): error C3203: 'result_of': unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): warning C4346: 'std::is_same<decay<_Ty>::type,decay<unknown-type>::type>::value': dependent name is not a type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): note: prefix with 'typename' to indicate a type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): error C3646: 'UnwrappedFn': unknown override specifier
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): error C2988: unrecognizable template declaration/definition
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(48): error C2059: syntax error: '('
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(49): error C2143: syntax error: missing ';' before '{'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(49): error C2447: '{': missing function header (old-style formal list?)
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): error C2039: 'result_of': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\string(24): note: see declaration of 'std'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): error C2947: expecting '>' to terminate template-argument-list, found '<'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): error C3203: 'result_of': unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): warning C4346: 'std::is_same<decay<_Ty>::type,zug::any_state>::value': dependent name is not a type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): note: prefix with 'typename' to indicate a type
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): error C3646: 'UnwrappedFn': unknown override specifier
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): error C2988: unrecognizable template declaration/definition
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(57): error C2059: syntax error: '('
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(58): error C2143: syntax error: missing ';' before '{'
C:\tmp\7qvvky2u\execroot\__main__\zug/with_state.hpp(58): error C2447: '{': missing function header (old-style formal list?)
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(182): error C2955: 'zug::result_of_t': use of alias template requires template argument list
C:\tmp\7qvvky2u\execroot\__main__\zug/meta.hpp(75): note: see declaration of 'zug::result_of_t'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(187): note: see reference to class template instantiation 'zug::transducer<InputT,OutputT>::get_transducer_state<OutputTs...>::apply<StateT,ReducingFnT,XformT>::get_state_wrapper<WrappedT>' being compiled
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(193): note: see reference to class template instantiation 'zug::transducer<InputT,OutputT>::get_transducer_state<OutputTs...>::apply<StateT,ReducingFnT,XformT>' being compiled
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(194): note: see reference to class template instantiation 'zug::transducer<InputT,OutputT>::get_transducer_state<OutputTs...>' being compiled
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(235): note: see reference to class template instantiation 'zug::transducer<InputT,OutputT>' being compiled
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(182): error C2059: syntax error: '<type-template-argument>'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(182): error C2059: syntax error: ')'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(182): error C2143: syntax error: missing ';' before '>'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(182): error C2059: syntax error: '>'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(182): error C2238: unexpected token(s) preceding ';'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(184): error C2672: 'std::declval': no matching overloaded function found
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(184): error C2770: invalid explicit template argument(s) for '_Add_reference<_Ty,void>::_Rvalue std::declval(void) noexcept'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(226): note: see declaration of 'std::declval'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(184): error C3539: a template-argument cannot be a type that contains 'decltype(auto)'
C:\tmp\7qvvky2u\execroot\__main__\zug/transducer/transducer.hpp(186): error C3203: 'transducer_tag': unspecialized class template can't be used as a template argument for template parameter 'TagT', expected a real type
INFO: Elapsed time: 4.322s, Critical Path: 3.82s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

How would one implement flatMap or bind with zug?

For example I'm looking for an equivalent to

std::vector<int> src = {1,2,3,4,5,6};

std::vector<int> result = 
    src 
    | flatMap([](int i){ return i%2 == 0 ? std::vector<int>{i,i+1} : std::vector<int>{i} ; })
    | toVector();

result should be

{1,2,3,3,4,5,5,6,7}

ie: flatMap (also known as bind) takes each element of the source and passes it to the function which is expected to return a sequence and all sequences are concatenated together.

Though reading through your doc maybe the way to do this is with map and then cat like.

std::vector<int> src = {1,2,3,4,5,6};
    | map([](int i){ return i%2 == 0 ? std::vector<int>{i,i+1} : std::vector<int>{i} ; })
    | cat();

I notice that you have a mapcat but it doesn't do the same as above. Maybe it should be renamed catmap because it is equivalent to cat | map rather than map | cat

I have my own two libraries that do the same as transducers with one for space mapping and one for temporal mapping. But I'm intrigued by the design of transducers that allows one implementation to handle both by factoring out the processes. I need to spend some time with it.

A small point. Somehow I prefer the term where rather than filter. I'm always have to think twice with filter whether the predicate means to include all things that return positive or exclude them. I think the problem is that filter is most often used with predicates in English as filter out which has the opposite meaning to where and filter as often used in libraries like transducers.

All dogs where tail length is longer than 20cm

vs

Filter out all dogs with tail length longer than 20cm

However I'm aware than different libraries use filter and where interchangeably so maybe it's just me.

Building tests fails with recent glibc

with zug 0.1.0:

[  1%] Building CXX object test/__inline_var_tests/CMakeFiles/inline_var_tests.dir/main.cpp.o
In file included from /data/misc/zug-0.1.0/test/__inline_var_tests/main.cpp:2:
/data/misc/zug-0.1.0/tools/include/catch2/catch.hpp:10376:34: error: constexpr variable 'sigStackSize' must be initialized by a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                 ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/misc/zug-0.1.0/tools/include/catch2/catch.hpp:10376:58: note: non-constexpr function 'sysconf' cannot be used in a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                                         ^
/usr/include/bits/sigstksz.h:32:22: note: expanded from macro 'MINSIGSTKSZ'
# define MINSIGSTKSZ SIGSTKSZ
                     ^
/usr/include/bits/sigstksz.h:28:19: note: expanded from macro 'SIGSTKSZ'
# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)
                  ^
/usr/include/unistd.h:640:17: note: declared here
extern long int sysconf (int __name) __THROW;
                ^
In file included from /data/misc/zug-0.1.0/test/__inline_var_tests/main.cpp:2:
/data/misc/zug-0.1.0/tools/include/catch2/catch.hpp:10435:33: error: variable length array declaration not allowed at file scope
    char FatalConditionHandler::altStackMem[sigStackSize] = {};
                                ^           ~~~~~~~~~~~~
2 errors generated

Also see: catchorg/Catch2#2421

Make boost optional dependency

Steps to achieve it:

  • There's only 1 place which always depends on boost, computation of return type for zug::sequence. Could it be changed?
  • Document usage of ZUG_VARIANT_{STD,BOOST} and ZUG_ENABLE_BOOST, add cmake option to switch variant implementation.
  • Integrate boost into cmake (to give ability to use boost from non-standard path easily).

Create a release

Hi! Thank you a lot for the awesome library!

Can you please make a release of the library? It'll help a lot with packaging your library in Conan since it's easier to choose proper package version with a release.

Thank you!

combining zug::drop_while and zug::last

I have a usecase like:

auto meas = std::vector<pair<size_t, char>>{{0,"a"},{1,"b"},{2,"c"},{3,"d"}};
auto get_timestamps=zug::map([](auto x){
            auto [t,b] = x; 
            return t;
});
auto all_timestamps = meas | get_timestamps;
auto first_ts = all_timestamps | zug::first;
auto after_c = meas | zug::drop_while([first_ts](auto a){ return a.first<first_ts; });

In essence I want a zug::tupilified reduced value to show up in a drop_while test.

This way I have automatic creation of the reduced value to be used as a comparator. I can filter based on the result of some other tail of a transducer chain.

This is a bad example because it would just drop all meas, but assume that I could transduce down to a subset of the full meas and use its last value. I haven't been able to get a recipe that allows its use in something like drop_while.

Linker error on zug::meta::bottom conversion operators

I get

CMakeFiles/test-into_vector.dir/into_vector.cpp.o: In function `_ZN3zug4skipIRZNKS_5map_tIZL29____C_A_T_C_H____T_E_S_T____4vEUliE0_EclIRKNS_6last_tEEEDaOT_EUlS9_DpOT0_E_NS_4meta6bottomEJiEEENS_11skip_resultIS8_T0_JDpT1_EE4typeES9_OSI_DpOSJ_':
/home/ltjax/code/zug/zug/skip.hpp:186: undefined reference to `zug::meta::bottom::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >() const'

and

CMakeFiles/test-transducer-eager.dir/transducer/eager.cpp.o: In function `decltype(auto) zug::reduce_nested<zug::last_t const&, zug::meta::bottom, zug::detail::iterator_range<std::reverse_iterator<__gnu_cxx::__normal_iterator<testing::copy_spy<testing::detail::default_copy_spy_base_t>*, std::vector<testing::copy_spy<testing::detail::default_copy_spy_base_t>, std::allocator<testing::copy_spy<testing::detail::default_copy_spy_base_t> > > > >, std::reverse_iterator<__gnu_cxx::__normal_iterator<testing::copy_spy<testing::detail::default_copy_spy_base_t>*, std::vector<testing::copy_spy<testing::detail::default_copy_spy_base_t>, std::allocator<testing::copy_spy<testing::detail::default_copy_spy_base_t> > > > > > >(zug::last_t const&, zug::meta::bottom&&, zug::detail::iterator_range<std::reverse_iterator<__gnu_cxx::__normal_iterator<testing::copy_spy<testing::detail::default_copy_spy_base_t>*, std::vector<testing::copy_spy<testing::detail::default_copy_spy_base_t>, std::allocator<testing::copy_spy<testing::detail::default_copy_spy_base_t> > > > >, std::reverse_iterator<__gnu_cxx::__normal_iterator<testing::copy_spy<testing::detail::default_copy_spy_base_t>*, std::vector<testing::copy_spy<testing::detail::default_copy_spy_base_t>, std::allocator<testing::copy_spy<testing::detail::default_copy_spy_base_t> > > > > >&&)':
/home/ltjax/code/zug/zug/reduce_nested.hpp:47: undefined reference to `zug::meta::bottom::operator testing::copy_spy<testing::detail::default_copy_spy_base_t>&<testing::copy_spy<testing::detail::default_copy_spy_base_t> >() const'

With g++ version 7.4.0. I guess this is because bottom's usage in the any_state ctor is not actually an unevaluated context.

Nix environment is broken on macos

I wanted to test locally my changes for a future pull request and the nix environment seems broken on MacOS. Here's the output of running nix-shell:

building '/nix/store/d3k1zgccyykrxnsxzwzzkhn871808cah-breathe-5074aecb5ad37bb70f50216eaa01d03a375801ec-src.drv'...
dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
  Referenced from: /nix/store/zdh6jqgv3ayqgl0ifj1z3f9n4s31d8s4-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
  Reason: image not found
error: builder for '/nix/store/d3k1zgccyykrxnsxzwzzkhn871808cah-breathe-5074aecb5ad37bb70f50216eaa01d03a375801ec-src.drv' failed due to signal 6 (Abort trap: 6);
       last 3 log lines:
       > dyld: Library not loaded: /usr/lib/system/libsystem_network.dylib
       >   Referenced from: /nix/store/zdh6jqgv3ayqgl0ifj1z3f9n4s31d8s4-Libsystem-osx-10.11.6/lib/libSystem.B.dylib
       >   Reason: image not found
       For full logs, run 'nix log /nix/store/d3k1zgccyykrxnsxzwzzkhn871808cah-breathe-5074aecb5ad37bb70f50216eaa01d03a375801ec-src.drv'.
error: 1 dependencies of derivation '/nix/store/sqf2k7cnwvqx4xq560bzlqq60z5csc7i-python2.7-breathe-git-arximboldi-5074aecb5ad37bb70f50216eaa01d03a375801ec.drv' failed to build
building '/nix/store/vp7b1p14phwkmjr047p4cr5m9vllkqz2-builder.pl.drv'...
error: 1 dependencies of derivation '/nix/store/rqkgr243m22d1jwr63q0j3x3d1gwr2zl-python-2.7.13-env.drv' failed to build
error: build of '/nix/store/575h7cmv25ijxmgip8sib2rgj27566l1-python3-3.8.5-env.drv', '/nix/store/71jgz7sv8vf3aa610pqq84b3xzbcq00f-sass-3.7.4.drv', '/nix/store/724fjxn5fgf7idlr15qdn11xqwrswr0h-immer-git-ffbc180da6463f8f06af0e96336f161256422b1f.drv', '/nix/store/dbcwi7vsnrvhbi0zph1wqhjg9qhchvz1-imgui-git-6ffee0e75e8f677c5fd8280dfe544c3fcb325f45.drv', '/nix/store/g4c95hwxzjyn58prg82a3vqwcxnf8iih-emscripten-2.0.1.drv', '/nix/store/hnhv3xk7m2rmi4g7q6959a38hrpsw5dh-cereal-git-arximboldi-f158a44a3277ec2e1807618e63bcb8e1bd559649.drv', '/nix/store/nqw5amnsd1py1w56q904rm8qi0srsb3r-libhttpserver-git-f4caf637090b5ff39bfc146b0ecd633f670c3697.drv', '/nix/store/rqkgr243m22d1jwr63q0j3x3d1gwr2zl-python-2.7.13-env.drv', '/nix/store/wyscvqk5z25v2di15jzvvcvj7qh2gnfh-zug-git-be20cae36e7e5876bf5bfb08b2a0562e1db3b546.drv' failed

It seems that the breathe library build is broken.

Zug + ETL

The ETL (https://github.com/ETLCPP/etl) is very useful in an embedded development context (e.g., No malloc/free, or exceptions).

I'm wondering if it makes sense to try to combine Zug with the ETL.

Thoughts?

skip.hpp has trouble building with MSVC++ 2019.

Here's output from my tests on a Windows machine I've gotten a hold of.

❯ bazel build ...
INFO: Analyzed 234 targets (1 packages loaded, 4 targets configured).
INFO: Found 234 targets...
ERROR: C:/tmp/yhlvxsm5/external/zug/test/BUILD.bazel:139:8: C++ compilation of rule '@zug//test:sequence_test' failed (Exit 2): cl.exe failed: error executing command
  cd C:/tmp/yhlvxsm5/execroot/__main__
  SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt
    SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
    SET PWD=/proc/self/cwd
    SET TEMP=C:\Users\yesudeep\AppData\Local\Temp
    SET TMP=C:\Users\yesudeep\AppData\Local\Temp
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/zug /Ibazel-out/x64_windows-fastbuild/bin/external/zug /Iexternal/boost /Ibazel-out/x64_windows-fastbuild/bin/external/boost /Iexternal/com_github_catchorg_catch2 /Ibazel-out/x64_windows-fastbuild/bin/external/com_github_catchorg_catch2 /Iexternal/bazel_tools /Ibazel-out/x64_windows-fastbuild/bin/external/bazel_tools /Iexternal/zug/include /Ibazel-out/x64_windows-fastbuild/bin/external/zug/include /Iexternal/boost /Ibazel-out/x64_windows-fastbuild/bin/external/boost /Iexternal/boost/boost/mpl /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/mpl /Iexternal/boost/boost/move /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/move /Iexternal/boost/boost/assert /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/assert /Iexternal/boost/boost/detail /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/detail /Iexternal/boost/boost/limits /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/limits /Iexternal/boost/boost/static_assert /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/static_assert /Iexternal/boost/boost/preprocessor /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/preprocessor /Iexternal/boost/boost/range /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/range /Iexternal/boost/boost/array /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/array /Iexternal/boost/boost/config /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/config /Iexternal/boost/boost/version /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/version /Iexternal/boost/boost/core /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/core /Iexternal/boost/boost/functional /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/functional /Iexternal/boost/boost/container_hash /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/container_hash /Iexternal/boost/boost/integer /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/integer /Iexternal/boost/boost/cstdint /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/cstdint /Iexternal/boost/boost/type_traits /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/type_traits /Iexternal/boost/boost/swap /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/swap /Iexternal/boost/boost/throw_exception /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/throw_exception /Iexternal/boost/boost/current_function /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/current_function /Iexternal/boost/boost/exception /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/exception /Iexternal/boost/boost/concept_check /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/concept_check /Iexternal/boost/boost/concept /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/concept /Iexternal/boost/boost/concept_archetype /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/concept_archetype /Iexternal/boost/boost/iterator /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/iterator /Iexternal/boost/boost/utility /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/utility /Iexternal/boost/boost/noncopyable /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/noncopyable /Iexternal/boost/boost/optional /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/optional /Iexternal/boost/boost/none /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/none /Iexternal/boost/boost/type /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/type /Iexternal/boost/boost/ref /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/ref /Iexternal/boost/boost/regex /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/regex /Iexternal/boost/boost/predef /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/predef /Iexternal/boost/boost/smart_ptr /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/smart_ptr /Iexternal/boost/boost/align /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/align /Iexternal/boost/boost/scoped_array /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/scoped_array /Iexternal/boost/boost/checked_delete /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/checked_delete /Iexternal/boost/boost/scoped_ptr /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/scoped_ptr /Iexternal/boost/boost/shared_array /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/shared_array /Iexternal/boost/boost/shared_ptr /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/shared_ptr /Iexternal/boost/boost/tuple /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/tuple /Iexternal/boost/boost/variant /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/variant /Iexternal/boost/boost/call_traits /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/call_traits /Iexternal/boost/boost/math /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/math /Iexternal/boost/boost/atomic /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/atomic /Iexternal/boost/boost/fusion /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/fusion /Iexternal/boost/boost/function_types /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/function_types /Iexternal/boost/boost/get_pointer /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/get_pointer /Iexternal/boost/boost/typeof /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/typeof /Iexternal/boost/boost/lambda /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/lambda /Iexternal/boost/boost/mp11 /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/mp11 /Iexternal/boost/boost/type_index /Ibazel-out/x64_windows-fastbuild/bin/external/boost/boost/type_index /Iexternal/com_github_catchorg_catch2/single_include /Ibazel-out/x64_windows-fastbuild/bin/external/com_github_catchorg_catch2/single_include /DZUG_VARIANT_STD=0 /DZUG_VARIANT_BOOST=1 /DZUG_ENABLE_BOOST=1 /DBOOST_FALLTHROUGH /DBOOST_ALL_NO_LIB /DHAVE_BAZEL_BUILD=1 /DCATCH_CONFIG_MAIN /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -DHAVE_BAZEL_BUILD /DHAVE_BAZEL_BUILD_WINDOWS /D_HAS_DEPRECATED_RESULT_OF=1 /D_HAS_DEPRECATED_UNCAUGHT_EXCEPTION=1 /std:c++latest /Fobazel-out/x64_windows-fastbuild/bin/external/zug/test/_objs/sequence_test/sequence.obj /c external/zug/test/sequence.cpp
Execution platform: @local_config_platform//:host
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(201): error C2187: syntax error: '<end Parse>' was unexpected here
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(201): error C2059: syntax error: '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(201): error C2143: syntax error: missing ';' before '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(203): error C2988: unrecognizable template declaration/definition
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(203): error C2059: syntax error: '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(203): error C2143: syntax error: missing ';' before '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(203): error C2447: '{': missing function header (old-style formal list?)
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(214): error C2187: syntax error: '<end Parse>' was unexpected here
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(214): error C2059: syntax error: '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(214): error C2143: syntax error: missing ';' before '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(216): error C2988: unrecognizable template declaration/definition
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(216): error C2059: syntax error: '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(216): error C2143: syntax error: missing ';' before '{'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(216): error C2447: '{': missing function header (old-style formal list?)
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/transducer/iter.hpp(37): error C2440: '<function-style-cast>': cannot convert from 'T' to 'zug::skip_state<zug::detail::sequence_data<ValueT,zug::composed<Fn,zug::take::<lambda_1>>> *,zug::state_wrapper<zug::take_tag,zug::detail::sequence_data<ValueT,zug::composed<Fn,zug::take::<lambda_1>>> *,int>>'
        with
        [
            T=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
        and
        [
            ValueT=int,
            Fn=zug::iter::<lambda_1>
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/transducer/iter.hpp(45): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1504): note: see reference to function template instantiation 'auto zug::iter::<lambda_1>::()::<lambda_1>::operator ()<StateT,>(_T5 &&)' being compiled
        with
        [
            StateT=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *,
            _T5=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1748): note: see reference to alias template instantiation 'std::_Decltype_invoke_nonzero<zug::iter::<lambda_1>::()::<lambda_1>,zug::detail::sequence_data<ValueT,zug::composed<Fn,zug::take::<lambda_1>>>*,>' being compiled
        with
        [
            ValueT=int,
            Fn=zug::iter::<lambda_1>
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(118): note: see reference to class template instantiation 'std::result_of<ReducingFnT (StateT)>' being compiled
        with
        [
            ReducingFnT=zug::iter::<lambda_1>::()::<lambda_1>,
            StateT=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(118): note: see reference to alias template instantiation 'std::result_of_t<zug::iter::<lambda_1>::()::<lambda_1>(StateT)>' being compiled
        with
        [
            StateT=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(157): note: see reference to class template instantiation 'zug::detail::skip_result_impl<ReducingFnT,StateT>' being compiled
        with
        [
            ReducingFnT=zug::iter::<lambda_1>::()::<lambda_1>,
            StateT=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/reductor.hpp(183): note: see reference to class template instantiation 'zug::skip_result<ReducingFnT,InitialStateT>' being compiled
        with
        [
            ReducingFnT=zug::iter::<lambda_1>::()::<lambda_1>,
            InitialStateT=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/reductor.hpp(182): note: see reference to alias template instantiation 'zug::skip_result_t<zug::iter::<lambda_1>::()::<lambda_1>,zug::detail::sequence_data<ValueT,zug::composed<Fn,zug::take::<lambda_1>>>*,>' being compiled
        with
        [
            ValueT=int,
            Fn=zug::iter::<lambda_1>
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/sequence.hpp(128): note: see reference to class template instantiation 'zug::empty_reductor<zug::iter::<lambda_1>::()::<lambda_1>,zug::detail::sequence_data<ValueT,zug::composed<Fn,zug::take::<lambda_1>>> *>' being compiled
        with
        [
            ValueT=int,
            Fn=zug::iter::<lambda_1>
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/sequence.hpp(186): note: see reference to class template instantiation 'zug::detail::sequence_data<ValueT,zug::composed<Fn,zug::take::<lambda_1>>>' being compiled
        with
        [
            ValueT=int,
            Fn=zug::iter::<lambda_1>
        ]
external/zug/test/sequence.cpp(67): note: see reference to class template instantiation 'zug::sequence_range<int,zug::composed<zug::take::<lambda_1>>,std::vector<int,std::allocator<int>>>::iterator' being compiled
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/transducer/iter.hpp(33): error C2672: 'wrap_state': no matching overloaded function found
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/transducer/iter.hpp(40): error C3861: 'call': identifier not found
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1785): error C2794: 'type': is not a member of any direct or indirect base class of 'std::result_of<ReducingFnT (StateT)>'
        with
        [
            ReducingFnT=zug::iter::<lambda_1>::()::<lambda_1>,
            StateT=zug::detail::sequence_data<int,zug::composed<zug::iter::<lambda_1>,zug::take::<lambda_1>>> *
        ]
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(118): error C2938: 'std::result_of_t' : Failed to specialize alias template
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/skip.hpp(124): error C2955: 'std::is_same': use of class template requires template argument list
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xtr1common(84): note: see declaration of 'std::is_same'
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/reductor.hpp(184): error C2955: 'zug::reductor_base': use of class template requires template argument list
C:\tmp\yhlvxsm5\execroot\__main__\external\zug\zug/reductor.hpp(22): note: see declaration of 'zug::reductor_base'
external/zug/test/sequence.cpp(99): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'res_t'
external/zug/test/sequence.cpp(102): note: No constructor could take the source type, or constructor overload resolution was ambiguous
INFO: Elapsed time: 13.745s, Critical Path: 10.82s
INFO: 61 processes: 61 local.
FAILED: Build did NOT complete successfully

Build errors on Mac OS 11 beta (Clang 12) (error: use of overloaded operator '!=' is ambiguous)

Use --sandbox_debug to see verbose messages from the sandbox wrapped_clang failed: error executing command 
  (cd /private/var/tmp/_bazel_yesudeep/148f9f6ebca6e47e7d6d5ed427a82e62/sandbox/darwin-sandbox/1184/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=11.0 \
    PATH='/Users/yesudeep/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Users/yesudeep/code/src/fzf/bin' \
    XCODE_VERSION_OVERRIDE=12.0.0.12A8189h \
  external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG '-std=c++11' -iquote external/zug -iquote bazel-out/darwin-fastbuild/bin/external/zug -iquote external/boost -iquote bazel-out/darwin-fastbuild/bin/external/boost -iquote external/com_github_catchorg_catch2 -iquote bazel-out/darwin-fastbuild/bin/external/com_github_catchorg_catch2 -iquote external/bazel_tools -iquote bazel-out/darwin-fastbuild/bin/external/bazel_tools -isystem external/zug/include -isystem bazel-out/darwin-fastbuild/bin/external/zug/include -isystem external/boost -isystem bazel-out/darwin-fastbuild/bin/external/boost -isystem external/boost/boost/mpl -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/mpl -isystem external/boost/boost/move -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/move -isystem external/boost/boost/assert -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/assert -isystem external/boost/boost/detail -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/detail -isystem external/boost/boost/limits -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/limits -isystem external/boost/boost/static_assert -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/static_assert -isystem external/boost/boost/preprocessor -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/preprocessor -isystem external/boost/boost/range -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/range -isystem external/boost/boost/array -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/array -isystem external/boost/boost/config -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/config -isystem external/boost/boost/version -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/version -isystem external/boost/boost/core -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/core -isystem external/boost/boost/functional -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/functional -isystem external/boost/boost/container_hash -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/container_hash -isystem external/boost/boost/integer -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/integer -isystem external/boost/boost/cstdint -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/cstdint -isystem external/boost/boost/type_traits -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/type_traits -isystem external/boost/boost/swap -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/swap -isystem external/boost/boost/throw_exception -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/throw_exception -isystem external/boost/boost/current_function -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/current_function -isystem external/boost/boost/exception -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/exception -isystem external/boost/boost/concept_check -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/concept_check -isystem external/boost/boost/concept -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/concept -isystem external/boost/boost/concept_archetype -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/concept_archetype -isystem external/boost/boost/iterator -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/iterator -isystem external/boost/boost/utility -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/utility -isystem external/boost/boost/noncopyable -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/noncopyable -isystem external/boost/boost/optional -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/optional -isystem external/boost/boost/none -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/none -isystem external/boost/boost/type -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/type -isystem external/boost/boost/ref -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/ref -isystem external/boost/boost/regex -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/regex -isystem external/boost/boost/predef -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/predef -isystem external/boost/boost/smart_ptr -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/smart_ptr -isystem external/boost/boost/align -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/align -isystem external/boost/boost/scoped_array -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/scoped_array -isystem external/boost/boost/checked_delete -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/checked_delete -isystem external/boost/boost/scoped_ptr -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/scoped_ptr -isystem external/boost/boost/shared_array -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/shared_array -isystem external/boost/boost/shared_ptr -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/shared_ptr -isystem external/boost/boost/tuple -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/tuple -isystem external/boost/boost/variant -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/variant -isystem external/boost/boost/call_traits -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/call_traits -isystem external/boost/boost/math -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/math -isystem external/boost/boost/atomic -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/atomic -isystem external/boost/boost/fusion -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/fusion -isystem external/boost/boost/function_types -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/function_types -isystem external/boost/boost/get_pointer -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/get_pointer -isystem external/boost/boost/typeof -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/typeof -isystem external/boost/boost/lambda -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/lambda -isystem external/boost/boost/mp11 -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/mp11 -isystem external/boost/boost/type_index -isystem bazel-out/darwin-fastbuild/bin/external/boost/boost/type_index -isystem external/com_github_catchorg_catch2/single_include -isystem bazel-out/darwin-fastbuild/bin/external/com_github_catchorg_catch2/single_include -MD -MF bazel-out/darwin-fastbuild/bin/external/zug/test/transducer/_objs/product_test/product.d -DBOOST_FALLTHROUGH '-DZUG_VARIANT_STD=0' '-DZUG_VARIANT_BOOST=1' '-DZUG_ENABLE_BOOST=1' '-DHAVE_BAZEL_BUILD=1' -DCATCH_CONFIG_MAIN '-frandom-seed=bazel-out/darwin-fastbuild/bin/external/zug/test/transducer/_objs/product_test/product.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=11.0' -DHAVE_BAZEL_BUILD '-std=c++2a' -Wall -Wreturn-type -Wuninitialized -Wunused-result '-Werror=narrowing' '-Werror=reorder' -Wunused-local-typedefs '-Werror=conversion-null' '-Werror=overlength-strings' '-Werror=pointer-arith' '-Werror=varargs' '-Werror=vla' '-Werror=write-strings' -Wmissing-declarations '-fdiagnostics-color=always' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/zug/test/transducer/product.cpp -o bazel-out/darwin-fastbuild/bin/external/zug/test/transducer/_objs/product_test/product.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/zug/test/transducer/product.cpp:14:
external/zug/include/zug/transducer/product.hpp:33:53: error: use of overloaded operator '!=' is ambiguous (with operand types 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator' and 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator')
    for (++first; !state_is_reduced(state) && first != last; ++first) {
                                              ~~~~~ ^  ~~~~
external/zug/include/zug/transducer/product.hpp:48:28: note: in instantiation of function template specialization 'zug::detail::reduce_nested_non_empty_product<const zug::last_t &, zug::meta::bottom, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &, const unsigned long>' requested here
            return detail::reduce_nested_non_empty_product(
                           ^
external/zug/include/zug/detail/iterator_facade.hpp:119:10: note: candidate function
    bool operator!=(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function
    bool operator==(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function (with reversed parameter order)
In file included from external/zug/test/transducer/product.cpp:12:
In file included from external/zug/include/zug/into_vector.hpp:11:
In file included from external/zug/include/zug/meta.hpp:11:
In file included from external/zug/include/zug/into.hpp:13:
In file included from external/zug/include/zug/transduce.hpp:11:
In file included from external/zug/include/zug/reduce.hpp:11:
external/zug/include/zug/detail/is_non_empty.hpp:23:21: error: use of overloaded operator '!=' is ambiguous (with operand types 'decltype(__c.begin())' (aka 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator') and 'decltype(__c.end())' (aka 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator'))
    return begin(r) != end(r) && is_non_empty(rs...);
           ~~~~~~~~ ^  ~~~~~~
external/zug/include/zug/reduce.hpp:71:20: note: in instantiation of function template specialization 'zug::detail::is_non_empty<zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>>' requested here
    return detail::is_non_empty(ranges...)
                   ^
external/zug/include/zug/into.hpp:34:5: note: in instantiation of function template specialization 'zug::transduce<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, const zug::output_t &, std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    transduce(std::forward<XformT>(xform),
    ^
external/zug/include/zug/into_vector.hpp:33:12: note: in instantiation of function template specialization 'zug::into<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > >, zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    return into(result_t{},
           ^
external/zug/test/transducer/product.cpp:65:16: note: in instantiation of function template specialization 'zug::into_vector<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    auto res = into_vector(product(idx), idx);
               ^
external/zug/include/zug/detail/iterator_facade.hpp:119:10: note: candidate function
    bool operator!=(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function
    bool operator==(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function (with reversed parameter order)
In file included from external/zug/test/transducer/product.cpp:14:
external/zug/include/zug/transducer/product.hpp:33:53: error: use of overloaded operator '!=' is ambiguous (with operand types 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator' and 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator')
    for (++first; !state_is_reduced(state) && first != last; ++first) {
                                              ~~~~~ ^  ~~~~
external/zug/include/zug/transducer/product.hpp:48:28: note: in instantiation of function template specialization 'zug::detail::reduce_nested_non_empty_product<const zug::output_t &, std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > > &, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &, const unsigned long &>' requested here
            return detail::reduce_nested_non_empty_product(
                           ^
external/zug/include/zug/into.hpp:34:5: note: in instantiation of function template specialization 'zug::transduce<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, const zug::output_t &, std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    transduce(std::forward<XformT>(xform),
    ^
external/zug/include/zug/into_vector.hpp:33:12: note: in instantiation of function template specialization 'zug::into<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > >, zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    return into(result_t{},
           ^
external/zug/test/transducer/product.cpp:65:16: note: in instantiation of function template specialization 'zug::into_vector<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    auto res = into_vector(product(idx), idx);
               ^
external/zug/include/zug/detail/iterator_facade.hpp:119:10: note: candidate function
    bool operator!=(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function
    bool operator==(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function (with reversed parameter order)
In file included from external/zug/test/transducer/product.cpp:12:
In file included from external/zug/include/zug/into_vector.hpp:11:
In file included from external/zug/include/zug/meta.hpp:11:
In file included from external/zug/include/zug/into.hpp:13:
In file included from external/zug/include/zug/transduce.hpp:11:
In file included from external/zug/include/zug/reduce.hpp:12:
In file included from external/zug/include/zug/detail/reduce_nested_non_empty.hpp:32:
external/zug/include/zug/detail/reduce_nested_non_empty_non_variadic.hpp:34:53: error: use of overloaded operator '!=' is ambiguous (with operand types 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator' and 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator')
    for (++first; !state_is_reduced(state) && first != last; ++first) {
                                              ~~~~~ ^  ~~~~
external/zug/include/zug/detail/reduce_nested_non_empty.hpp:51:12: note: in instantiation of function template specialization 'zug::detail::reduce_nested_non_empty_non_variadic<(lambda at external/zug/include/zug/transducer/product.hpp:47:16), std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    return ZUG_REDUCE_NESTED_NON_EMPTY_NON_VARIADIC_IMPL(
           ^
external/zug/include/zug/detail/reduce_nested_non_empty.hpp:34:20: note: expanded from macro 'ZUG_REDUCE_NESTED_NON_EMPTY_NON_VARIADIC_IMPL'
    ::zug::detail::reduce_nested_non_empty_non_variadic
                   ^
external/zug/include/zug/into.hpp:34:5: note: in instantiation of function template specialization 'zug::transduce<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, const zug::output_t &, std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    transduce(std::forward<XformT>(xform),
    ^
external/zug/include/zug/into_vector.hpp:33:12: note: in instantiation of function template specialization 'zug::into<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > >, zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    return into(result_t{},
           ^
external/zug/test/transducer/product.cpp:65:16: note: in instantiation of function template specialization 'zug::into_vector<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    auto res = into_vector(product(idx), idx);
               ^
external/zug/include/zug/detail/iterator_facade.hpp:119:10: note: candidate function
    bool operator!=(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function
    bool operator==(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function (with reversed parameter order)
In file included from external/zug/test/transducer/product.cpp:14:
external/zug/include/zug/transducer/product.hpp:33:53: error: use of overloaded operator '!=' is ambiguous (with operand types 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator' and 'zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>>::iterator')
    for (++first; !state_is_reduced(state) && first != last; ++first) {
                                              ~~~~~ ^  ~~~~
external/zug/include/zug/transducer/product.hpp:48:28: note: in instantiation of function template specialization 'zug::detail::reduce_nested_non_empty_product<const zug::output_t &, std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &, const unsigned long &>' requested here
            return detail::reduce_nested_non_empty_product(
                           ^
external/zug/include/zug/detail/reduce_nested_non_empty.hpp:51:12: note: in instantiation of function template specialization 'zug::detail::reduce_nested_non_empty_non_variadic<(lambda at external/zug/include/zug/transducer/product.hpp:47:16), std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    return ZUG_REDUCE_NESTED_NON_EMPTY_NON_VARIADIC_IMPL(
           ^
external/zug/include/zug/detail/reduce_nested_non_empty.hpp:34:20: note: expanded from macro 'ZUG_REDUCE_NESTED_NON_EMPTY_NON_VARIADIC_IMPL'
    ::zug::detail::reduce_nested_non_empty_non_variadic
                   ^
external/zug/include/zug/into.hpp:34:5: note: in instantiation of function template specialization 'zug::transduce<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, const zug::output_t &, std::__1::back_insert_iterator<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > > >, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    transduce(std::forward<XformT>(xform),
    ^
external/zug/include/zug/into_vector.hpp:33:12: note: in instantiation of function template specialization 'zug::into<std::__1::vector<std::__1::tuple<unsigned long, unsigned long>, std::__1::allocator<std::__1::tuple<unsigned long, unsigned long> > >, zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    return into(result_t{},
           ^
external/zug/test/transducer/product.cpp:65:16: note: in instantiation of function template specialization 'zug::into_vector<zug::composed<(lambda at external/zug/include/zug/transducer/product.hpp:46:17)>, zug::sequence_range<unsigned long, zug::composed<(lambda at external/zug/include/zug/transducer/count.hpp:40:17), (lambda at external/zug/include/zug/transducer/take.hpp:41:17)>> &>' requested here
    auto res = into_vector(product(idx), idx);
               ^
external/zug/include/zug/detail/iterator_facade.hpp:119:10: note: candidate function
    bool operator!=(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function
    bool operator==(const DerivedT& rhs) const
         ^
external/zug/include/zug/detail/iterator_facade.hpp:115:10: note: candidate function (with reversed parameter order)
5 errors generated.
INFO: Elapsed time: 139.441s, Critical Path: 32.68s
INFO: 1350 processes: 1350 darwin-sandbox.
FAILED: Build did NOT complete successfully

Build failure when using std::variant

I got this build failure:

/usr/include/zug/sequence.hpp:225:47: error: wrong number of template arguments (1, should be at least 2)
  225 |                       std::decay_t<RangeTs>...>
      |                                               ^
/usr/include/zug/sequence.hpp:158:8: note: provided for ‘template<class ValueT, class XformT, class ... RangeTs> struct zug::sequence_range’
  158 | struct sequence_range
      |        ^~~~~~~~~~~~~~
/usr/include/zug/sequence.hpp:225:47: error: wrong number of template arguments (1, should be at least 2)
  225 |                       std::decay_t<RangeTs>...>
      |                                               ^
/usr/include/zug/sequence.hpp:158:8: note: provided for ‘template<class ValueT, class XformT, class ... RangeTs> struct zug::sequence_range’
  158 | struct sequence_range
      |        ^~~~~~~~~~~~~~
/usr/include/zug/sequence.hpp:225:47: error: wrong number of template arguments (1, should be at least 2)
  225 |                       std::decay_t<RangeTs>...>
      |                                               ^
/usr/include/zug/sequence.hpp:158:8: note: provided for ‘template<class ValueT, class XformT, class ... RangeTs> struct zug::sequence_range’
  158 | struct sequence_range
      |        ^~~~~~~~~~~~~~
/usr/include/zug/sequence.hpp:225:47: error: wrong number of template arguments (1, should be at least 2)
  225 |                       std::decay_t<RangeTs>...>
      |                                               ^
/usr/include/zug/sequence.hpp:158:8: note: provided for ‘template<class ValueT, class XformT, class ... RangeTs> struct zug::sequence_range’
  158 | struct sequence_range
      |        ^~~~~~~~~~~~~~
/usr/include/zug/sequence.hpp:220:8: error: invalid template-id
  220 |     -> sequence_range<typename boost::mpl::eval_if<
      |        ^~~~~~~~~~~~~~
/usr/include/zug/sequence.hpp:220:32: error: ‘boost’ has not been declared
  220 |     -> sequence_range<typename boost::mpl::eval_if<
      |                                ^~~~~
/usr/include/zug/sequence.hpp:220:51: error: expected ‘(’ before ‘<’ token
  220 |     -> sequence_range<typename boost::mpl::eval_if<
      |                                                   ^
      |                                                   (
/usr/include/zug/sequence.hpp:221:74: error: expected primary-expression before ‘,’ token
  221 |                           std::is_same<ValueT, detail::deduce_value_type>,
      |                                                                          ^
/usr/include/zug/sequence.hpp:223:50: error: expected initializer before ‘::’ token
  223 |                           meta::identity<ValueT>>::type,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.