Small C++11 tweaks.
[libsub.git] / src / dcp_reader.cc
index 663ddf89a4af2f4bfdb132dac0f29000bfaef8f3..0c7a29a90aaa9d564f3f18932c00e305599fbd55 100644 (file)
 #include <dcp/smpte_subtitle_asset.h>
 #include <boost/filesystem.hpp>
 
-using std::cout;
-using std::string;
+using std::dynamic_pointer_cast;
 using std::exception;
+using std::make_shared;
 using std::shared_ptr;
+using std::string;
 using boost::optional;
-using std::dynamic_pointer_cast;
 using namespace sub;
 
 static Time
@@ -52,21 +52,21 @@ DCPReader::DCPReader (boost::filesystem::path file)
        string smpte_error;
 
        try {
-               sc.reset (new dcp::InteropSubtitleAsset (file));
+               sc = make_shared<dcp::InteropSubtitleAsset>(file);
        } catch (exception& e) {
                interop_error = e.what ();
        }
 
        if (!sc) {
                try {
-                       sc.reset (new dcp::SMPTESubtitleAsset (file));
+                       sc = make_shared<dcp::SMPTESubtitleAsset>(file);
                } catch (exception& e) {
                        smpte_error = e.what();
                }
        }
 
        if (!sc) {
-               throw DCPError (String::compose ("Could not read subtitles (%1 / %2)", interop_error, smpte_error));
+               throw DCPError(String::compose("Could not read subtitles (%1 / %2)", interop_error, smpte_error));
        }