Puzzle #4 (based on C++17)
Wrong answer. Try again or show the answer.
#include <tuple>
#include <utility>
#include <functional>
#include <iostream>

template <typename A, typename B>
struct foo
  foo(A, B) {};

template <typename A, typename B>
auto make_foo(A&& a, B&& b)
  return foo{ std::forward<A>(a), std::forward<B>(b) };

int main()
  decltype(auto) a = 0;
  decltype(auto) b = std::ref(a);

  auto f1 = foo(a, b);
  auto f2 = make_foo(a, b);

  auto p1 = std::pair(a, b);
  auto p2 = std::make_pair(a, b);

  auto t1 = std::tuple(a, b);
  auto t2 = std::make_tuple(a, b);

  std::cout << std::is_same_v<decltype(f1), decltype(f2)>;
  std::cout << std::is_same_v<decltype(p1), decltype(p2)>;
  std::cout << std::is_same_v<decltype(t1), decltype(t2)>;
With given code and C++17 compiler, pick one answer:
Guaranteed to print: 000
Guaranteed to print: 001
Guaranteed to print: 010
Guaranteed to print: 011
Guaranteed to print: 100
Guaranteed to print: 101
Guaranteed to print: 110
Guaranteed to print: 111
Guaranteed to print something else
Undefined bahaviour
Implementation defined
Will not compile