#include <iostream>
#include <utility>

struct PotentiallyThrowing {
    int value;
    char path;
    explicit PotentiallyThrowing(int input) : value{input}, path{'I'} {}
    PotentiallyThrowing(const PotentiallyThrowing& other)
        : value{other.value}, path{'C'} {}
    PotentiallyThrowing(PotentiallyThrowing&& other)
        : value{other.value}, path{'M'} {}
};

struct SafeMove {
    int value;
    char path;
    explicit SafeMove(int input) : value{input}, path{'I'} {}
    SafeMove(const SafeMove& other) : value{other.value}, path{'C'} {}
    SafeMove(SafeMove&& other) noexcept : value{other.value}, path{'M'} {}
};

int main() {
    PotentiallyThrowing first{4};
    SafeMove second{4};
    PotentiallyThrowing copied{std::move_if_noexcept(first)};
    SafeMove moved{std::move_if_noexcept(second)};
    std::cout << copied.path << ' ' << copied.value << '\n';
    std::cout << moved.path << ' ' << moved.value << '\n';
}
