Skip to content

Commit b86122f

Browse files
committed
workaround compilers disagreeing (see https://godbolt.org/z/GcjWhrb9W )
1 parent 21940b5 commit b86122f

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

libmamba/include/mamba/download/mirror.hpp

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ namespace mamba::download
6767
MirrorRequest& operator=(MirrorRequest&&) = default;
6868
};
6969

70+
struct MirrorStats // Moved out of Mirror internals because of compilers not agreeing: https://godbolt.org/z/GcjWhrb9W
71+
{
72+
std::optional<std::size_t> allowed_connections = std::nullopt;
73+
std::size_t max_tried_connections = 0;
74+
std::size_t running_transfers = 0;
75+
std::size_t successful_transfers = 0;
76+
std::size_t failed_transfers = 0;
77+
};
78+
7079
// A Mirror represents a location from where an asset can be downloaded.
7180
// It handles the generation of required requests to get the asset, and
7281
// provides some statistics about its usage.
@@ -110,24 +119,9 @@ namespace mamba::download
110119
MirrorID m_id;
111120
size_t m_max_retries;
112121

113-
struct Stats
114-
{
115-
Stats() = default;
116-
Stats(const Stats&) = default;
117-
Stats(Stats&&) noexcept = default;
118-
Stats& operator=(const Stats&) = default;
119-
Stats& operator=(Stats&&) noexcept = default;
120-
121-
std::optional<std::size_t> allowed_connections = std::nullopt;
122-
std::size_t max_tried_connections = 0;
123-
std::size_t running_transfers = 0;
124-
std::size_t successful_transfers = 0;
125-
std::size_t failed_transfers = 0;
126-
};
127-
128-
static_assert(std::default_initializable<Stats>);
122+
static_assert(std::default_initializable<MirrorStats>);
129123

130-
util::synchronized_value<Stats> m_stats;
124+
util::synchronized_value<MirrorStats> m_stats;
131125

132126
};
133127

0 commit comments

Comments
 (0)