Skip to content

Commit

Permalink
Remove constexpr from CommandApdu() to fix vector() is not constexpr …
Browse files Browse the repository at this point in the history
…error

WE2-1007

Signed-off-by: Mart Somermaa <[email protected]>
  • Loading branch information
mrts committed Sep 20, 2024
1 parent 16ecdcb commit bbaf5b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/libpcsc-cpp/include/pcsc-cpp/pcsc-cpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ struct CommandApdu
static constexpr size_t MAX_DATA_SIZE = 255;

// Case 1
constexpr CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2) : d {cls, ins, p1, p2} {}
CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2) : d {cls, ins, p1, p2} {}

// Case 2
constexpr CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2, byte_type le) :
CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2, byte_type le) :
d {cls, ins, p1, p2, le}
{
}

// Case 3
constexpr CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2, byte_vector data) :
CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2, byte_vector data) :
d {std::move(data)}
{
if (d.size() > MAX_DATA_SIZE) {
Expand All @@ -164,7 +164,7 @@ struct CommandApdu
}

// Case 4
constexpr CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2, byte_vector data,
CommandApdu(byte_type cls, byte_type ins, byte_type p1, byte_type p2, byte_vector data,
byte_type le) : CommandApdu {cls, ins, p1, p2, std::move(data)}
{
d.push_back(le);
Expand Down

0 comments on commit bbaf5b3

Please sign in to comment.