1 |
commit: 29b377c53e8b0785400167d6dc62f29667f046ab |
2 |
Author: Petteri Räty <petsku <AT> petteriraty <DOT> eu> |
3 |
AuthorDate: Sun Jun 10 21:39:18 2012 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 8 09:41:25 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=29b377c5 |
7 |
|
8 |
Replace boost::scoped_ptr with std::unique_ptr |
9 |
|
10 |
const std::unique_ptr provides everything that boost::scoped_ptr does so |
11 |
no need to rely on it. |
12 |
|
13 |
--- |
14 |
src/cppbash_builtin.cpp | 2 +- |
15 |
src/cppbash_builtin.h | 3 +-- |
16 |
2 files changed, 2 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/src/cppbash_builtin.cpp b/src/cppbash_builtin.cpp |
19 |
index 51cd15c..7c9cb84 100644 |
20 |
--- a/src/cppbash_builtin.cpp |
21 |
+++ b/src/cppbash_builtin.cpp |
22 |
@@ -57,7 +57,7 @@ cppbash_builtin::cppbash_builtin(BUILTIN_ARGS): _out_stream(&out), _err_stream(& |
23 |
} |
24 |
|
25 |
cppbash_builtin::builtins_type& cppbash_builtin::builtins() { |
26 |
- static boost::scoped_ptr<builtins_type> p(new builtins_type { |
27 |
+ static const std::unique_ptr<builtins_type> p(new builtins_type { |
28 |
{"break", boost::factory<break_builtin*>()}, |
29 |
{"continue", boost::factory<continue_builtin*>()}, |
30 |
{"echo", boost::factory<echo_builtin*>()}, |
31 |
|
32 |
diff --git a/src/cppbash_builtin.h b/src/cppbash_builtin.h |
33 |
index 5b27fad..c6feb65 100644 |
34 |
--- a/src/cppbash_builtin.h |
35 |
+++ b/src/cppbash_builtin.h |
36 |
@@ -31,7 +31,6 @@ |
37 |
|
38 |
#include <boost/functional/factory.hpp> |
39 |
#include <boost/function.hpp> |
40 |
-#include <boost/scoped_ptr.hpp> |
41 |
#include <boost/utility.hpp> |
42 |
|
43 |
/// shortcut for the arguments of the constructor |
44 |
@@ -89,7 +88,7 @@ class cppbash_builtin: public boost::noncopyable |
45 |
const std::vector<std::string>& args, |
46 |
BUILTIN_ARGS) |
47 |
{ |
48 |
- boost::scoped_ptr<cppbash_builtin> p(builtins()[builtin](out,err,in,walker)); |
49 |
+ const std::unique_ptr<cppbash_builtin> p(builtins()[builtin](out,err,in,walker)); |
50 |
return p->exec(args); |
51 |
} |