Skip to content

Commit

Permalink
Fix compat with cxx98 standard
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed May 23, 2023
1 parent 4cab74d commit cb708fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion json/sample-json-vpHomogeneousMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ int main()
#if defined(VISP_HAVE_NLOHMANN_JSON)
std::string filename = "homo-mat.json";
{
vpHomogeneousMatrix M(vpTranslationVector(0.1, 0.2, 0.3), vpRotationMatrix({ 0, 0, -1, 0, -1, 0, -1, 0, 0 }));
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
vpHomogeneousMatrix M(vpTranslationVector(0.1, 0.2, 0.3), vpRotationMatrix({ 0, 0, 1, 0, -1, 0, -1, 0, 0 }));
#else
vpHomogeneousMatrix M;
M[0][0] = 0; M[0][1] = 0; M[0][2] = 1; M[0][2] = 0.1;
M[1][0] = 0; M[1][1] = -1; M[1][2] = 0; M[1][2] = 0.2;
M[2][0] = -1; M[2][1] = 0; M[2][2] = 0; M[2][2] = 0.3;
#endif
std::ofstream file(filename);
const nlohmann::json j = M;
file << j;
Expand Down

0 comments on commit cb708fa

Please sign in to comment.