std::basic_ifstream::close(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… std::basic_ifstream::close πŸ’…

okay so bestie, this is std::basic_ifstream::close from the C++ Standard Libary manual, section 3 β€” yes, that's the manual name, and we're keeping it cute and exact πŸ’–.

πŸ’– NAME πŸ’–

std::basic_ifstream::close β€” std::basic_ifstream::close (same on both sides, iconic behavior, no notes).

✨ Synopsis ✨

void close();

Closes the associated file. Effectively calls rdbuf()->close(). If an error occurs during operation, setstate(failbit) is called. No cap, that's the whole flow 🌸.

πŸŽ€ Parameters πŸŽ€

(none) β€” zero arguments, zero stress, she takes nothing.

πŸ’– Return value πŸ’–

(none) β€” returns absolutely nothing, periodt πŸ’….

🌸 Notes 🌸

This function is called by the destructor of basic_ifstream when the stream object goes out of scope and is not usually invoked directly. So like, most of the time the destructor is the main character here, and you're just vibing πŸ¦‹.

πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example. (Yes, the example section is literally a todo, and we're respecting the canon 😭)

πŸ‘‘ See also πŸ‘‘

  • is_open β€” checks if the stream has an associated file (public member function)
  • open β€” opens a file and associates it with the stream (public member function)
  • close β€” flushes the put area buffer and closes the associated file (public member function of std::basic_filebuf<CharT,Traits>)

πŸ’… Category πŸ’…

  • * Todo no example

source: http://cppreference.com, version/date: 2024.06.10, page: std::basic_ifstream::close(3) β€” mwah, bye bestie! πŸ’–βœ¨

πŸ“¦ where this page comes from