rhalbersma / dctl Goto Github PK
View Code? Open in Web Editor NEWDraughts and checkers template library
License: Boost Software License 1.0
Draughts and checkers template library
License: Boost Software License 1.0
This allows better layout of basic_action
and basic_state
and automatic generation of operator==
for these classes.
Note that this is not yet supported for Visual C++.
jump_sources
for short-ranged piecesHi all,
DCTL failed to build with "error C2280, error C2088, error C3889..."with MSVC on Windows. Could you please help look at this issue?
Environment:
Windows: windows server 2019
VS: 2019
Repro steps:
1.open VS2019 x64 tools command
2.git clone https://github.com/rhalbersma/dctl F:\gitP\rhalbersma\dctl
3.cd F:\gitP\rhalbersma\dctl
4.mkdir build_amd64 & cd F:\gitP\rhalbersma\dctl\build_amd64
5.set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
6.msbuild /m /p:Platform=x64 /p:Configuration=Release dctl.sln /t:Rebuild
Error info:
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(221,86): error C2280: 'bool dctl::core::basic_action<dctl::core::block_adl::international,dctl::core::block_adl::basic_boarddctl::core::block_adl::international>::operator ==(const dctl::core::basic_action<dctl::core::block_adl::international,dctl::core::block_adl::basic_boarddctl::core::block_adl::international> &) const': attempting to reference a deleted function [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(221,86): error C2088: '==': illegal for class [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(221,37): error C3889: call to object of class type 'std::ranges::_None_of_fn': no matching call operator found [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\gitP\rhalbersma\dctl\include\dctl/core/model/detail/builder.hpp(204,55): error C2297: '||': not valid as right operand has type 'void' [F:\gitP\rhalbersma\dctl\build_amd64\example\play.vcxproj]
F:\tools\boost_1_70_0\x64\boost/graph/topological_sort.hpp(44,1): error C2220: the following warning is treated as an error [F:\gitP\rhalbersma\dctl\build_amd64\test\egdb.divide.vcxproj]
log
build.log
as prototyped in https://wandbox.org/permlink/QiIS657FQvDT7Y1r
The endgame indexing has a clang workaround. We should apply creduce to reduce this to a manageable example.
DCTL failed to run egdb.database test on release and debug configuration with MSVC on Windows. It can be reproduced on master branch latest reversion a63d2a3. Could you help take a look at this? Thanks a lot.
Repro steps:
Failures:
Start 35: egdb.database
35/37 Test #35: egdb.database ........................Exit code 0xc0000135
***Exception: 0.05 sec
Start 36: egdb.index
36/37 Test #36: egdb.index ........................... Passed 0.34 sec
Start 37: util.literals
37/37 Test #37: util.literals ........................ Passed 0.05 sec
97% tests passed, 1 tests failed out of 37
Total Test time (real) = 2.87 sec
The following tests FAILED:
35 - egdb.database (Exit code 0xc0000135
)
Use modern CMake conventions to separate library configuration from tests and examples.
DCTL failed with C2988 C2059 C2334 when built by msvc on Windows, I use source db7db34 on master branch. Could you help take a look at this? Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.
Repro steps:
Failures:
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(142,1): error C2988: unrecognizable template declaration/definition
XSTD_PP_CONSTEXPR_INTRINSIC static auto squares_filter(UnaryPredicate pred) noexcept
^
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(301): note: see reference to class template instantiation 'dctl::core::block_adl::basic_board' being compiled
};
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(142,1): error C2059: syntax error: 'constant'
XSTD_PP_CONSTEXPR_INTRINSIC static auto squares_filter(UnaryPredicate pred) noexcept
^
D:\DCTL\src\include\dctl\core\board\basic_board.hpp(143,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
{
^
We are currently lacking data members in the state class to track the most recently moved kings.
Why is there no ZERO
? Asking for a friend.
If and when Boost 1.66 comes out.
DCTL failed with error C2679 when build by msvc on Windows, I use latest version 2ee0699 on master branch. Could you please help take a look at this? Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.
You can repro this issue as the steps below:
Our workaround:
database.hpp:
std::copy(m_files.begin(), m_files.end(), std::ostream_iteratorstd::string(std::cout, "\n"));
=>
std::copy(m_files.begin(), m_files.end(), std::ostream_iterator<std::wstring, wchar_t>(std::wcout, L"\n"));
Error info:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(1784): error C2679: binary '=': no operator found which takes a right-hand operand of type 'std::filesystem::path' (or there is no acceptable conversion)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\iterator(232): note: could be 'std::ostream_iterator<std::string,char,std::char_traits> &std::ostream_iterator<std::string,char,std::char_traits>::operator =(std::ostream_iterator<std::string,char,std::char_traits> &&)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\iterator(232): note: or 'std::ostream_iterator<std::string,char,std::char_traits> &std::ostream_iterator<std::string,char,std::char_traits>::operator =(const std::ostream_iterator<std::string,char,std::char_traits> &)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\iterator(208): note: or 'std::ostream_iterator<std::string,char,std::char_traits> &std::ostream_iterator<std::string,char,std::char_traits>::operator =(const _Ty &)'
with
[
_Ty=std::string
]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(1784): note: while trying to match the argument list '(std::ostream_iterator<std::string,char,std::char_traits>, std::filesystem::path)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(1821): note: see reference to function template instantiation '_OutIt std::_Copy_uncheckedstd::filesystem::path*,_Iter(_InIt,_InIt,_OutIt)' being compiled
with
[
_OutIt=std::ostream_iterator<std::string,char,std::char_traits>,
_Iter=std::ostream_iterator<std::string,char,std::char_traits>,
_InIt=std::filesystem::path *
]
D:\DCTL\src\include\dctl\egdb\database.hpp(53): note: see reference to function template instantiation '_OutIt std::copy<std::_Vector_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,std::ostream_iterator<std::string,char,std::char_traits>>(_InIt,_InIt,_OutIt)' being compiled
with
[
_OutIt=std::ostream_iterator<std::string,char,std::char_traits>,
_Ty=std::filesystem::path,
_InIt=std::_Vector_iterator<std::_Vector_val<std::_Simple_typesstd::filesystem::path>>
]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\filesystem(2066): note: see reference to class template instantiation 'std::chrono::time_pointstd::filesystem::_File_time_clock,std::filesystem::_File_time_clock::duration' being compiled
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xstring(1689): note: see reference to class template instantiation 'std::basic_string_view<wchar_t,std::char_traits<wchar_t>>' being compiled
if constexp
on separate lineThis enables several assert() staetments in to_square(coordinates<upper_left>, Grid).
Do not forget to add Tanzanian rule (American checkers but with flying king) we will appreciate. It is only available in few apps, but most famous one is Dalmax checkers for Android.
action_view
(inspired by std::string_view
) that can adopt either
action_view
should support
make
on statesundo
on statesstd::vector
, boost::dynamic_bitset
A good proxy for sparsity might be the number of empty squares minus 4 times (or another small power of 2) the number of pieces:
if this is negative, the pieces are dense (say 40 pawns on a 10x10 board, 50 - (4 + 1) * 40 = -150).
if this is non-negative, the pieces are sparse (say 10 kings on a 10x10 board: 50 - (4 + 1) * 10 = 0).
Since the initial position starts with densely packed men, the default for pawns should be per-direction filtering followed by per-piece processing.
In endgames, pieces are mostly sparsely packed, the default for kings should therefore be per-piece processing over all directions simultaneously.
The question is whether we should dynamically check for sparsity for pawns and kings. In pathological positions (40 kings e.g.) we get a massive slow-down. If __builtin_expect
is cheap enough, it might be worthwhile to test for this. Note that we currently already check for pieces(/*piece type*/).empty()
. Instead, we might now branch on pieces(/*piece type*/).count()
.
Note that for long-ranged king moves, per-direction filtering should be followed by per-piece lookups on the remaining empty squares ahead. This is what Moby Dam implements unconditionally.
The various variable templates should live in the dctl namespace, similar to the rule traits.
Test that operator! works correctly on the enum, types and global constants.
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.