PrevUpHomeNext

utx::printfn

utx::printfn prints a list of different types of values to a file without worrying about their types.

template <utx::kspt::printable ... R>
void utx::printfn(const std::string & fn, const R & ... r);

Include

#include <utxcpp/core.hpp>

Notice

[Note] Note
  • It prints a newline character at the end.
  • It separates each value by a space.
  • concept requirements:
    • Every value must satisfy utx::kspt::printable
    • Basic printable types satisfy utx::kspt::printable
    • Non-basic types must implement operator<< to satisfy utx::kspt::printable
  • utx::printfn is suitable for simple and small cases. To have advanced and complex features, please refer to std::fstream.

Example

#include <utxcpp/core.hpp>

int main() {
	utx::printfn("out.txt", true, ':', 2.15, "kg", "fish");
}

PrevUpHomeNext