コード例 #1
0
ファイル: maybe_front.cpp プロジェクト: freundlich/fcppt
	fcppt::optional::reference<
		int const
	>
	optional_int_ref;

	int_vector const empty{};

	CHECK_FALSE(
		fcppt::container::maybe_front(
			empty
		).has_value()
	);

	int_vector const vec12{
		1,
		2
	};

	CHECK(
		fcppt::container::maybe_front(
			vec12
		)
		==
		optional_int_ref(
			fcppt::make_cref(
				vec12.front()
			)
		)
	);
}