Skip to content
Snippets Groups Projects
Commit 51b26cab authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

Any proper RAII class must either handle copying or be noncopyable.

NamedTempFile makes no attempt to deal with copying, therefore make it
noncopyable.
parent 74fbd318
No related branches found
No related tags found
No related merge requests found
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
#include "apr_file_io.h" #include "apr_file_io.h"
#include <string> #include <string>
#include <boost/function.hpp> #include <boost/function.hpp>
#include "boost/lambda/lambda.hpp" #include <boost/lambda/lambda.hpp>
#include "boost/lambda/bind.hpp" #include <boost/lambda/bind.hpp>
#include <boost/noncopyable.hpp>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
* Create a text file with specified content "somewhere in the * Create a text file with specified content "somewhere in the
* filesystem," cleaning up when it goes out of scope. * filesystem," cleaning up when it goes out of scope.
*/ */
class NamedTempFile class NamedTempFile: public boost::noncopyable
{ {
public: public:
NamedTempFile(const std::string& pfx, const std::string& content, apr_pool_t* pool=gAPRPoolp): NamedTempFile(const std::string& pfx, const std::string& content, apr_pool_t* pool=gAPRPoolp):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment