>>137
C++17の std::optional を使うところかな

戻り値をstd::optional<std::pair<string, string>>にして
意味論的に不正な場合は std::nullopt を返す

C++17以前なら boost::optional もあり