utils: cached_file: Fix compilation error

Fix field initialization order problem.

In file included from ./sstables/mc/bsearch_clustered_cursor.hh:28,
                 from sstables/index_reader.hh:32,
                 from sstables/sstables.cc:49:
./utils/cached_file.hh: In constructor 'cached_file::stream::stream(cached_file&, const seastar::io_priority_class&, tracing::trace_state_ptr, cached_file::page_idx_type, cached_file::offset_type)':
./utils/cached_file.hh:119:34: error: 'cached_file::stream::_trace_state' will be initialized after [-Werror=reorder]
  119 |         tracing::trace_state_ptr _trace_state;
      |                                  ^~~~~~~~~~~~
./utils/cached_file.hh:117:23: error:   'cached_file::page_idx_type cached_file::stream::_page_idx' [-Werror=reorder]
  117 |         page_idx_type _page_idx;
      |                       ^~~~~~~~~
./utils/cached_file.hh:127:9: error:   when initialized here [-Werror=reorder]
  127 |         stream(cached_file& cf, const io_priority_class& pc, tracing::trace_state_ptr trace_state,
      |         ^~~~~~
Message-Id: <1592478082-22505-1-git-send-email-tgrabiec@scylladb.com>
This commit is contained in:
Tomasz Grabiec
2020-06-18 13:01:22 +02:00
committed by Nadav Har'El
parent 03db448a92
commit 17ee1a2eed

View File

@@ -128,10 +128,9 @@ public:
page_idx_type start_page, offset_type start_offset_in_page)
: _cached_file(&cf)
, _pc(&pc)
, _trace_state(std::move(trace_state))
, _page_idx(start_page)
, _offset_in_page(start_offset_in_page)
, _trace_state(std::move(trace_state))
{ }
// Yields the next chunk of data.