export module debug.assertions; import lsd; export namespace lt::debug { template struct ensure { ensure( const Expression_T &expression, lsd::format_str fmt, Args_T &&...args, const lsd::src_location &location = lsd::src_location::current() ); }; template ensure(Expression_T, lsd::format_str, Args_T &&...) -> ensure; template ensure::ensure( const Expression_T &expression, lsd::format_str fmt, Args_T &&...args, const lsd::src_location &location ) { if (!static_cast(expression)) { throw lsd::runtime_error { lsd::format( "exception: {}\nlocation: {}:{}", lsd::format(fmt, lsd::forward(args)...), location.file_name(), location.line() ) }; } } } // namespace lt::debug