Skip to content

Commit

Permalink
construct a std::span directly, no make_span() utility (generates CA …
Browse files Browse the repository at this point in the history
…diagnostic)
  • Loading branch information
Dan Smith committed Jan 17, 2022
1 parent d81a4d1 commit 8e308af
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions externals/nitro/modules/c++/nitf/source/SegmentSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,15 @@ SegmentMemorySource::SegmentMemorySource(const std::span<const std::byte>& s, ni
{
}

static std::span<const std::byte> make_span(const std::vector<std::byte>& data) noexcept
{
return std::span<const std::byte>(data.data(), data.size());
}
SegmentMemorySource::SegmentMemorySource(const std::vector<std::byte>& data,
nitf::Off start, int byteSkip, bool copyData)
: SegmentMemorySource(make_span(data), start, byteSkip, copyData)
: SegmentMemorySource(std::span<const std::byte>(data.data(), data.size()), start, byteSkip, copyData)
{
}

static std::span<const sys::byte> make_span(const std::vector<sys::byte>& data) noexcept
{
return std::span<const sys::byte>(data.data(), data.size());
}
SegmentMemorySource::SegmentMemorySource(const std::vector<sys::byte>& data,
nitf::Off start, int byteSkip, bool copyData)
: SegmentMemorySource(make_span(data), start, byteSkip, copyData)
: SegmentMemorySource(std::span<const sys::byte>(data.data(), data.size()), start, byteSkip, copyData)
{
}
}
Expand Down

0 comments on commit 8e308af

Please sign in to comment.