Make use of C++17 std::optional<> instead of boost::optional<>.

This commit is contained in:
Christian Parpart
2019-10-28 11:39:30 +01:00
parent 302a51a58c
commit df729b3084
67 changed files with 173 additions and 168 deletions
+2 -2
View File
@@ -147,14 +147,14 @@ bool FullInliner::recursive(FunctionDefinition const& _fun) const
void InlineModifier::operator()(Block& _block)
{
function<boost::optional<vector<Statement>>(Statement&)> f = [&](Statement& _statement) -> boost::optional<vector<Statement>> {
function<std::optional<vector<Statement>>(Statement&)> f = [&](Statement& _statement) -> std::optional<vector<Statement>> {
visit(_statement);
return tryInlineStatement(_statement);
};
iterateReplacing(_block.statements, f);
}
boost::optional<vector<Statement>> InlineModifier::tryInlineStatement(Statement& _statement)
std::optional<vector<Statement>> InlineModifier::tryInlineStatement(Statement& _statement)
{
// Only inline for expression statements, assignments and variable declarations.
Expression* e = boost::apply_visitor(GenericFallbackReturnsVisitor<Expression*, ExpressionStatement, Assignment, VariableDeclaration>(