PZ
enum class Foo : int {};
enum class Bar : int {};Size: a a a
PZ
enum class Foo : int {};
enum class Bar : int {};PZ
Foo value = 50;
Bar value = 60;
АК
Foo value = 50;
Bar value = 60;
void foo(Foo); foo(50) - это хороший код? :)PZ
range | some_view(...)PZ
void foo(Foo); foo(50) - это хороший код? :)АК
Foo value = Foo{50} (см. std::byte)IZ
Foo value = 50;
Bar value = 60;
PZ
PZ
using Foo = int;
using Bar = int;
Foo foo = 0;
Bar bar = foo; // Error: could not cast Foo to const Bar& in Bar::Bar(const Bar&)
PZ
range | some_view(...)AU
IZ
using Foo = int;
using Bar = int;
Foo foo = 0;
Bar bar = foo; // Error: could not cast Foo to const Bar& in Bar::Bar(const Bar&)
AP
split_when. Если его еще нет в стандарте, надо написать свой.PZ
IZ
using Foo = int;
using Bar = int;
Foo foo = 0;
Bar bar = foo; // Error: could not cast Foo to const Bar& in Bar::Bar(const Bar&)
PZ
using Foo = std::string;
using Bar = std::string;
Foo foo = "hello";
Bar bar = foo; // Error: could not cast Foo to const Bar& in Bar::Bar(const Bar&)
IZ
using Foo = std::string;
using Bar = std::string;
Foo foo = "hello";
Bar bar = foo; // Error: could not cast Foo to const Bar& in Bar::Bar(const Bar&)
PZ
IZ
using Foo = std::string;
using Bar = std::string;
Foo foo = "hello";
Bar bar = foo; // Error: could not cast Foo to const Bar& in Bar::Bar(const Bar&)
VV