62e5e2
From 5e61a97a0b56d3d4121d3cbb6b85032f9839545a Mon Sep 17 00:00:00 2001
62e5e2
From: nre <nre@ableton.com>
62e5e2
Date: Thu, 22 Dec 2016 13:25:35 +0100
62e5e2
Subject: [PATCH] Fix compiler error with release builds on VS2015
62e5e2
62e5e2
When using MSVC compiler optimization, using param_not_found() causes
62e5e2
compiler error C4172: returning address of local variable or temporary
62e5e2
---
62e5e2
 include/boost/graph/named_function_params.hpp | 3 ++-
62e5e2
 1 file changed, 2 insertions(+), 1 deletion(-)
62e5e2
62e5e2
diff --git a/include/boost/graph/named_function_params.hpp b/include/boost/graph/named_function_params.hpp
62e5e2
index a9a9add6c..4842dc954 100644
62e5e2
--- a/include/boost/graph/named_function_params.hpp
62e5e2
+++ b/include/boost/graph/named_function_params.hpp
62e5e2
@@ -228,6 +228,7 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
62e5e2
   };
62e5e2
 
62e5e2
   struct param_not_found {};
62e5e2
+  static param_not_found g_param_not_found;
62e5e2
 
62e5e2
   template <typename Tag, typename Args>
62e5e2
   struct get_param_type: 
62e5e2
@@ -237,7 +238,7 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
62e5e2
   inline
62e5e2
   const typename lookup_named_param_def<Tag, Args, param_not_found>::type&
62e5e2
   get_param(const Args& p, Tag) {
62e5e2
-    return lookup_named_param_def<Tag, Args, param_not_found>::get(p, param_not_found());
62e5e2
+    return lookup_named_param_def<Tag, Args, param_not_found>::get(p, g_param_not_found);
62e5e2
   }
62e5e2
 
62e5e2
   template <class P, class Default>