Skip to content

Commit

Permalink
remove reference_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokartikey committed Aug 29, 2023
1 parent 55b0e59 commit e6560c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/chess++/move.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CHESSPP_MOVE_H

#include <array>
#include <functional>
#include <optional>
#include <string_view>

Expand Down Expand Up @@ -34,7 +33,7 @@ class Move {

private:
int index_;
std::array<std::optional<std::reference_wrapper<Ply>>, 2> ply_;
std::array<std::optional<Ply>, 2> ply_;
};
} // namespace chess

Expand Down
7 changes: 3 additions & 4 deletions src/chess++/piece.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef CHESSPP_PIECE_H
#define CHESSPP_PIECE_H

#include <functional>
#include <optional>
#include <vector>

Expand Down Expand Up @@ -33,13 +32,13 @@ class Piece {
} // namespace chess

namespace chess::types {
using piece_optional = std::optional<std::reference_wrapper<Piece>>;
using piece_vector = std::vector<std::reference_wrapper<Piece>>;
using piece_optional = std::optional<Piece>;
using piece_vector = std::vector<Piece>;
using nullpiece = std::nullopt_t;
} // namespace chess::types

namespace chess {
constexpr std::nullopt_t nullpiece = std::nullopt;
constexpr types::nullpiece nullpiece = std::nullopt;
}

#endif
1 change: 0 additions & 1 deletion src/chess++/square.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef CHESSPP_SQUARE_H
#define CHESSPP_SQUARE_H

#include <functional>
#include <vector>

#include "constants.h"
Expand Down

0 comments on commit e6560c7

Please sign in to comment.