From 14595c68aa48a97e18a995f8aa99cf778fac731d Mon Sep 17 00:00:00 2001 From: Parichay Kapoor Date: Thu, 4 Feb 2021 14:26:10 +0900 Subject: [PATCH] [app_context] Resolve build issue with gcc5 This solves the build issue for gcc5 when using std::call_once Original code calls bind with copy of the argument to the function and fails are reference is expected with gcc5 This patch adds a std::ref explicitly to make this work with gcc5 **Self evaluation:** 1. Build test: [x]Passed [ ]Failed [ ]Skipped 2. Run test: [x]Passed [ ]Failed [ ]Skipped Signed-off-by: Parichay Kapoor --- nntrainer/app_context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nntrainer/app_context.cpp b/nntrainer/app_context.cpp index d3ef567..cbe5033 100644 --- a/nntrainer/app_context.cpp +++ b/nntrainer/app_context.cpp @@ -106,7 +106,8 @@ static void add_default_object(AppContext &ac) { AppContext &AppContext::Global() { static AppContext instance; - std::call_once(global_app_context_init_flag, add_default_object, instance); + std::call_once(global_app_context_init_flag, add_default_object, + std::ref(instance)); return instance; } -- 2.7.4