From 4b73cce76ee44bf724ea8f157e2823ac407e5e7c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Nov 2021 11:44:45 +0100 Subject: [PATCH] C++: make the member funciton layout_info and root_item `const` It might be called with a const pointer --- sixtyfps_compiler/generator/cpp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sixtyfps_compiler/generator/cpp.rs b/sixtyfps_compiler/generator/cpp.rs index d5963ad55..07dc535d5 100644 --- a/sixtyfps_compiler/generator/cpp.rs +++ b/sixtyfps_compiler/generator/cpp.rs @@ -1361,7 +1361,7 @@ fn generate_component( Access::Public, Declaration::Function(Function { name: "root_item".to_owned(), - signature: "()".into(), + signature: "() const".into(), statements: Some(vec![format!("return {};", get_root_item)]), ..Default::default() }), @@ -1372,7 +1372,7 @@ fn generate_component( Declaration::Function(Function { name: "layout_info".into(), signature: - "(sixtyfps::Orientation o, [[maybe_unused]] sixtyfps::private_api::WindowRc *window_handle) -> sixtyfps::LayoutInfo" + "(sixtyfps::Orientation o, [[maybe_unused]] const sixtyfps::private_api::WindowRc *window_handle) const -> sixtyfps::LayoutInfo" .into(), statements: Some(layout_info_function_body( &component,