MSVC build fixes

release/4.3a0
Jose Luis Blanco-Claraco 2019-12-27 20:42:41 +01:00 committed by Jose Luis Blanco Claraco
parent 6c9fa5194d
commit e658aed6bd
No known key found for this signature in database
GPG Key ID: D443304FBD70A641
2 changed files with 8 additions and 1 deletions

View File

@ -81,6 +81,11 @@ if(MSVC)
WINDOWS_LEAN_AND_MEAN
NOMINMAX
)
# Avoid literally hundreds to thousands of warnings:
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC
/wd4267 # warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
)
endif()
# Other (non-preprocessor macros) compiler flags:

View File

@ -348,7 +348,9 @@ namespace gtsam {
throw ValuesKeyDoesNotExist("at", j);
// Check the type and throw exception if incorrect
return internal::handle<ValueType>()(j,item->second);
// h() split in two lines to avoid internal compiler error (MSVC2017)
auto h = internal::handle<ValueType>();
return h(j,item->second);
}
/* ************************************************************************* */