diff options
| author | Phil Nash | 2013-11-18 00:21:11 -0800 |
|---|---|---|
| committer | Phil Nash | 2013-11-18 00:21:11 -0800 |
| commit | da0f4643f7ce911b5ce173d54e13a3e5dc579203 (patch) | |
| tree | e12e3032dddab20631370ee9e6b7a40e577b513e /include | |
| parent | d3c8c9839fd418e5f169fe4a104a2affb37bd5ff (diff) | |
| parent | d1e5480d957d3ef39be921a693a24798b4015fbd (diff) | |
| download | catch3-da0f4643f7ce911b5ce173d54e13a3e5dc579203.tar.gz | |
Merge pull request #217 from nanoant/patch/std-auto_ptr-deprecated
std::auto_ptr is deprecated in c++11/c++0x
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/clara.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/internal/clara.h b/include/internal/clara.h index fa58da79..a401edd8 100644 --- a/include/internal/clara.h +++ b/include/internal/clara.h @@ -305,6 +305,13 @@ namespace Clara { int position; }; + // NOTE: std::auto_ptr is deprecated in c++11/c++0x +#if defined(__cplusplus) && __cplusplus > 199711L + typedef std::unique_ptr<Arg> ArgAutoPtr; +#else + typedef std::auto_ptr<Arg> ArgAutoPtr; +#endif + class ArgBinder { public: template<typename F> @@ -329,7 +336,7 @@ namespace Clara { else if( m_arg.isAnyPositional() ) { if( m_cl->m_arg.get() ) throw std::logic_error( "Only one unpositional argument can be added" ); - m_cl->m_arg = std::auto_ptr<Arg>( new Arg( m_arg ) ); + m_cl->m_arg = ArgAutoPtr( new Arg( m_arg ) ); } else m_cl->m_options.push_back( m_arg ); @@ -373,7 +380,7 @@ namespace Clara { m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ) { if( other.m_arg.get() ) - m_arg = std::auto_ptr<Arg>( new Arg( *other.m_arg ) ); + m_arg = ArgAutoPtr( new Arg( *other.m_arg ) ); } template<typename F> @@ -543,7 +550,7 @@ namespace Clara { Detail::BoundArgFunction<ConfigT> m_boundProcessName; std::vector<Arg> m_options; std::map<int, Arg> m_positionalArgs; - std::auto_ptr<Arg> m_arg; + ArgAutoPtr m_arg; int m_highestSpecifiedArgPosition; }; |