OSDN Git Service

optional が初期化されていなかったら例外を投げるように変更
authorstarg <starg@users.osdn.me>
Fri, 2 Sep 2016 09:04:20 +0000 (18:04 +0900)
committerstarg <starg@users.osdn.me>
Fri, 2 Sep 2016 09:04:20 +0000 (18:04 +0900)
src/ast2ir/phrase2ir.cpp

index 3154552..3a3a95d 100644 (file)
@@ -109,7 +109,7 @@ std::vector<IR::Block::EventType> Phrase2IRCompiler::operator()(const AST::NoteS
 
     if (ast.Attributes.empty())
     {
-        return (*this)(*ast.NoteSeq);
+        return (*this)(ast.NoteSeq.value());
     }
     else
     {
@@ -122,7 +122,7 @@ std::vector<IR::Block::EventType> Phrase2IRCompiler::operator()(const AST::NoteS
 
         if (ast.NoteSeq.is_initialized())
         {
-            auto events = (*this)(*ast.NoteSeq);
+            auto events = (*this)(ast.NoteSeq.value());
             m_IR.Blocks[newIndex.ID].Events.insert(m_IR.Blocks[newIndex.ID].Events.end(), events.begin(), events.end());
         }