diff --git a/ridlbe/c++11/visitors/struct.rb b/ridlbe/c++11/visitors/struct.rb index 580570ec..1ece1e28 100644 --- a/ridlbe/c++11/visitors/struct.rb +++ b/ridlbe/c++11/visitors/struct.rb @@ -59,6 +59,9 @@ def is_array? def value_initializer # When we have an annotation directly applied to this node we are using it + if optional? + return '{std::nullopt}' + end unless node.annotations[:default].first.nil? "{#{node.annotations[:default].first.fields[:value]}}" else