Skip to content

Conversation

@funatsufumiya
Copy link
Contributor

@funatsufumiya funatsufumiya commented Aug 25, 2025

Confirmed working both macOS / Windows oF v0.12.1

( I also confirmed that without .string() not works on Windows. )

@funatsufumiya
Copy link
Contributor Author

Now it's working also on oF v0.12.0 ( the same one to #2. )

@NickHardeman NickHardeman merged commit 62e9e3e into NickHardeman:main Aug 25, 2025
@NickHardeman
Copy link
Owner

Thank you!

@funatsufumiya funatsufumiya changed the title Fix for Windows oF v0.12.1 Fix for Windows, both oF v0.12.1 / oF v0.12.0 Aug 25, 2025
@funatsufumiya
Copy link
Contributor Author

funatsufumiya commented Aug 25, 2025

Thank you for merging.

As an aside, I myself was troubled by the mixing of std::optional and boost::optional in other projects, so creating a custom class might be a good idea.

@funatsufumiya
Copy link
Contributor Author

funatsufumiya commented Aug 31, 2025

I recently confirmed #include <optional> is available on oF 0.12.0 default settings. So in this case, true problem was just not included <optional>.

Now it's OK that now using another optional class. FIY, I'm using this in my another project to make std::optional compatible as possible.

#pragma once

#if __cplusplus >= 201703L
#if __has_include(<optional>)

#define USE_STD_OPTIONAL

#endif // __has_include(<optional>)
#endif // __cplusplus >= 201703L

#ifdef USE_STD_OPTIONAL
#include <optional>
#else
#include "nonstd/optional.hpp"
#endif // USE_STD_OPTIONAL

namespace opt { // as you like

#ifdef USE_STD_OPTIONAL

    using std::optional;
    using std::nullopt;

    static std::nullopt_t none = std::nullopt;

#else

    using nonstd::optional;
    using nonstd::nullopt;

    static nonstd::nullopt_t none = nonstd::nullopt;

#endif // USE_STD_OPTIONAL

}

// now you can use optional as opt::optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants