Skip to content

Stale piece to char usage #31

Description

@winapiadmin

Describe the bug

chesslib/position.cpp

Lines 411 to 413 in 66278aa

constexpr std::string_view EnginePieceToChar(" PNBRQK pnbrqk ");
constexpr std::string_view PolyglotPieceToChar("PNBRQKpnbrqk ");
constexpr std::string_view PieceToChar = std::is_same_v<PieceC, EnginePiece> ? EnginePieceToChar : PolyglotPieceToChar;

That have been stale since I have a new piece enum ContiguousMappingPiece.

Minimal, Reproducible Example

#include "position.h"
using namespace chess;
int main(){
    _Position<PolyglotPiece> p;
    Position p2(p.state());
    _Position<PolyglotPiece> p3(p2.state());
    assert(p.fen()==p3.fen());
    assert(p.fen()==p2.fen());
}

Expects to not be assertion, got asserted

Activity

  1. winapiadmin commented on Dec 11, 2025

    @winapiadmin
    OwnerAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions