Skip to content

Fix for Windows, both oF v0.12.1 / oF v0.12.0 - #3

Merged
NickHardeman merged 3 commits into
NickHardeman:mainfrom
ffunatsu:PRs/2
Aug 25, 2025
Merged

Fix for Windows, both oF v0.12.1 / oF v0.12.0#3
NickHardeman merged 3 commits into
NickHardeman:mainfrom
ffunatsu:PRs/2

Conversation

@ffunatsu

@ffunatsu ffunatsu commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

Confirmed working both macOS / Windows oF v0.12.1

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

@ffunatsu

Copy link
Copy Markdown
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
Copy Markdown
Owner

Thank you!

@ffunatsu ffunatsu 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
@ffunatsu

ffunatsu commented Aug 25, 2025

Copy link
Copy Markdown
Contributor Author

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.

@ffunatsu

ffunatsu commented Aug 31, 2025

Copy link
Copy Markdown
Contributor Author

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