Skip to content

Commit

Permalink
Added alignment for the data member.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocielliottc committed Feb 24, 2023
1 parent a9abe96 commit 564882b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dds/DCPS/XTypes/TypeObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ namespace XTypes {
}

Optional(const Optional& rhs)
: present_(false) {
: present_(false),
value_()
{
*this = rhs;
}

Expand Down Expand Up @@ -140,7 +142,10 @@ namespace XTypes {

private:
bool present_;
unsigned char value_[sizeof(T)];
union {
ACE_CDR::LongDouble max_alignment;
unsigned char value_[sizeof(T)];
};
};

template <typename T>
Expand Down

0 comments on commit 564882b

Please sign in to comment.