GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::basic_streambuf::~basic_streambuf(3) C++ Standard Libary std::basic_streambuf::~basic_streambuf(3)

std::basic_streambuf::~basic_streambuf - std::basic_streambuf::~basic_streambuf


virtual ~basic_streambuf();


This destruction is empty: the members of this basic_streambuf (the pointers and the
locale) are destructed in accordance with the usual object destruction sequence
after this destructor returns. However, since it is declared public virtual, it
allows the objects that are derived from std::basic_streambuf to be deleted through
a pointer to base class.


(none)

// Run this code


#include <iostream>
#include <fstream>


int main()
{
std::filebuf* fbp = new std::filebuf;
fbp->open("test.txt", std::ios_base::out);
fbp->sputn("Hello\n", 6);
std::streambuf* sbp = fbp;
delete sbp; // the file is closed, output flushed and written
std::ifstream f("test.txt");
std::cout << f.rdbuf(); // proof
}


Hello


constructor constructs a basic_streambuf object
(protected member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.