Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C++

Compiler

gcc HEAD 9.0.0 20180919 (experimental)

Options
Warnings
Boost 1.68.0
C++2a(GNU)
no pedantic
Raw compiler options
-O3 impl.cpp

Author

anonymous

over 6 years ago

data.h
impl.cpp

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-head/include -std=gnu++2a -O3 impl.cpp
std::vector<Data>{
  Data{ .id = 0, .next = 1 },
  Data{ .id = 1, .next = 3 },
  Data{ .id = 2, .next = 4 },
  Data{ .id = 3, .next = 3 },
  Data{ .id = 4, .next = 5 },
  Data{ .id = 5, .next = 5 },
};

[0].emplace({ .id = 0, .next = 3 });
[2].emplace({ .id = 2, .next = 5 });

std::vector<Data>{
  Data{ .id = 0, .next = 3 },
  Data{ .id = 1, .next = 3 },
  Data{ .id = 2, .next = 5 },
  Data{ .id = 3, .next = 3 },
  Data{ .id = 4, .next = 5 },
  Data{ .id = 5, .next = 5 },
};
Exit Code:
0