Code Monkey home page Code Monkey logo

patterns's Issues

Does not compile under MSVC 2019

While not explicitly stated as being a supported compiler, the Microsoft Visual C++ compiler should fall under "standard conformant C++17 compiler".

Trying to compile gives an error on C++17 checking:
https://godbolt.org/z/frsGsb

Additionally, if this is circumvented by commenting out the check in config.hpp , some explicit GCC pragmas in as_tuple.hpp are unrecognized by MSVC and needed to be commented out as well.

Finally, when I tried to compile the fizzbuzz example, I got the following error: Context does not allow for disambiguation of overloaded function

Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  main.cpp
C:\dev\c++\my_proj\third_party\patterns\include\mpark\patterns/match.hpp(736,30): message : Context does not allow for disambiguation of overloaded function [C:\dev\c++\my_proj\build\prog.vcxproj]
C:\dev\c++\my_proj\third_party\patterns\include\mpark\patterns/match.hpp(987): message : see reference to function template instantiation 'auto mpark::patterns::try_match<int,int,std::tuple<_Ty &&,_Ty &&>,mpark::patter
ns::detail::Match<R,int,int>::()::<lambda_1>::()::<lambda_1>>(const mpark::patterns::Ds<int,int> &,Values &&,F &&)' being compiled [C:\dev\c++\my_proj\build\prog.vcxproj]
          with
          [
              _Ty=int,
              R=mpark::patterns::detail::Deduce,
              Values=std::tuple<int &&,int &&>,
              F=mpark::patterns::detail::Match<mpark::patterns::detail::Deduce,int,int>::()::<lambda_1>::()::<lambda_1>
          ]
C:\dev\c++\my_proj\src\main.cpp(46): message : see reference to function template instantiation 'decltype(auto) mpark::patterns::detail::Match<R,int,int>::operator ()<mpark::patterns::detail::Pattern<false,int,int>,Rhs
&&,mpark::patterns::detail::Case<mpark::patterns::detail::Pattern<false,int,mpark::patterns::Identifier<18446744073709551615,void>>,fizzbuzz::<lambda_2> &&>,mpark::patterns::detail::Case<mpark::patterns::detail::Pattern<false,mpark::patt
erns::Identifier<18446744073709551615,void>,int>,fizzbuzz::<lambda_3> &&>,mpark::patterns::detail::Case<mpark::patterns::detail::Pattern<false,mpark::patterns::Identifier<18446744073709551615,void>,mpark::patterns::Identifier<18446744073
709551615,void>>,fizzbuzz::<lambda_4> &&>>(mpark::patterns::detail::Case<mpark::patterns::detail::Pattern<false,int,int>,Rhs &&> &&,mpark::patterns::detail::Case<mpark::patterns::detail::Pattern<false,int,mpark::patterns::Identifier<1844
6744073709551615,void>>,fizzbuzz::<lambda_2> &&> &&,mpark::patterns::detail::Case<mpark::patterns::detail::Pattern<false,mpark::patterns::Identifier<18446744073709551615,void>,int>,fizzbuzz::<lambda_3> &&> &&,mpark::patterns::detail::Cas
e<mpark::patterns::detail::Pattern<false,mpark::patterns::Identifier<18446744073709551615,void>,mpark::patterns::Identifier<18446744073709551615,void>>,fizzbuzz::<lambda_4> &&> &&) &&' being compiled [C:\dev\c++\game_dev\opengl_platforme
r\build\prog.vcxproj]
          with
          [
              R=mpark::patterns::detail::Deduce,
              Rhs=fizzbuzz::<lambda_1>
          ]

Again, while MSVC isn't explicitly supported, I think it could be worthwhile to state that in practice only GCC and Clang are supported and tested.

Cool project never the less!

Linker error with test

Steps:

git clone .....
git submodule init
git submodule update --init --recursive
mkdir bla && cd bla
cmake -G Ninja ./ ../
then enabled tests in the cmake cache before building
ninja
and got these type of errors:

test/CMakeFiles/array.dir/array.cpp.o:
 In function `auto mpark::patterns::detail::grouped_indices<&mpark::patterns::detail::{lambda(unsigned long)#2}::_FUN, , 9223372036854775807ul, 18446744073709551615ul, 0ul, 1ul>(mpark::patterns::lib::list<>, std::integer_sequence<unsigned long, 9223372036854775807ul, 18446744073709551615ul>, mpark::patterns::lib::list<><unsigned long, 0ul, 1ul>)::{lambda()#1}::operator()() const':
array.cpp:(.text+0x9a13): undefined reference to `mpark::patterns::lib::list<mpark::patterns::lib::indexed_type<9223372036854775807ul, std::integer_sequence<unsigned long, 0ul> > > mpark::patterns::detail::insert<9223372036854775807ul, 0ul>(mpark::patterns::lib::list<>)'
collect2: error: ld returned 1 exit status
[26/30] Building CXX object test/CMakeFiles/when.dir/when.cpp.o
ninja: build stopped: subcommand failed.

compiler used was: gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0

Link to ISO proposal

I think it would be useful to add at least a related work link to your ISO proposal (i.e. https://github.com/mpark/wg21 & http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1260r0.pdf ) on the front page.

A discussion of how the two differ would be even better.
For instance I note that the "WHEN clause" of this project becomes a pattern guard in the proposal.

A related but distinct issue is the relationship between this and the earlier Mach7. Why use one rather than the other?

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.