mpark / patterns Goto Github PK
View Code? Open in Web Editor NEWThis is an experimental library that has evolved to P2688
Home Page: https://wg21.link/p2688
License: Boost Software License 1.0
This is an experimental library that has evolved to P2688
Home Page: https://wg21.link/p2688
License: Boost Software License 1.0
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!
[deleted]
Support for C-style array and Aggregates.
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.