Skip to content

Commit

Permalink
Refs #17138. Fix std::vector<bool> as array
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Feb 20, 2024
1 parent 7417ff1 commit 0661294
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/fastcdr/CdrSizeCalculator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,21 @@ class CdrSizeCalculator
return calculated_size;
}

/*!
* @brief Specific template which calculates the encoded size of an std::vector of bool as an array.
* @param[in] data Reference to the instance.
* @param[inout] current_alignment Current alignment in the encoding.
* @return Encoded size of the instance.
*/
TEMPLATE_SPEC
size_t calculate_array_serialized_size(
const std::vector<bool>& data,
size_t& current_alignment)
{
current_alignment += data.size();
return data.size();
}

/*!
* @brief Generic template which calculates the encoded size of the constructed type's member of a unknown type.
* @tparam _T Member's type.
Expand Down

0 comments on commit 0661294

Please sign in to comment.