Skip to content

Commit

Permalink
Merge pull request #12 from fix8mt/dev
Browse files Browse the repository at this point in the history
Dev 1.0j
  • Loading branch information
dakka authored Jul 19, 2024
2 parents 3455f33 + 11d8d7c commit fd07101
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
|6|[Notes](#7-notes)| Notes on the implementation, limits, etc|
|7|[Compilers](#8-compiler-support)| Supported compilers|
|8|[Compiler issues](#9-compiler-issues)| Workarounds for various compiler issues|
|9|[Results of `source_location`](reference/source_location.md)| For implementation specific `std::source_location` results|
|9|[Results of `std::source_location`](reference/source_location.md)| For implementation specific `std::source_location` results|
> [!TIP]
> Use the built-in [table of contents](https://github.blog/changelog/2021-04-13-table-of-contents-support-in-markdown-files/) to navigate this guide.
> Even better in [full read view](./README.md) of this page.
Expand Down Expand Up @@ -1308,7 +1308,7 @@ master will not be considered.
## a) enum limits
### `ENUM_MIN_VALUE`, `ENUM_MAX_VALUE`
These are set by default unless you override them by defining them in your application.
> [!NOTE]
> [!IMPORTANT]
> If you want to define these values they must appear _before_ you include `conjure_enum.hpp`.
The following are the default settings:
Expand All @@ -1321,6 +1321,10 @@ The following are the default settings:
#endif
```
These definitions set the minimum and maximum enum values that are supported. You can adjust them to suit your requirements but for most use cases the defaults are sufficient.
> [!TIP]
> You can reduce compile times in some circumstances by narrowing the range of `ENUM_MIN_VALUE` and `ENUM_MAX_VALUE`. For example
> if your enums are only within the range of say `0-16` you can set `ENUM_MIN_VALUE` and `ENUM_MAX_VALUE` to `0` and `16` respectively. If the range is _too_ narrow
> `conjure_enum` will **ignore enum values outside your range**.

## b) Class `conjure_enum` is not constructible
All methods in this class are _static_. You cannot instantiate an object of this type. The same goes for `conjure_type`.
Expand Down
6 changes: 3 additions & 3 deletions examples/srcloctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ Since the output of std::source_location is entirely implementation dependent, f
changes may occur.
Usage: )" << argv[0] << " [-cmh]" << R"(
-c show compiler (default true)
-m output using markdown
-h help
-c show compiler (default true)
-m output using markdown
-h help
)";
return 0;
}
Expand Down
6 changes: 6 additions & 0 deletions examples/statictest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//----------------------------------------------------------------------------------------
#include <iostream>
#if not defined ENUM_MIN_VALUE
# define ENUM_MIN_VALUE 0
#endif
#if not defined ENUM_MAX_VALUE
# define ENUM_MAX_VALUE 9
#endif
#include <fix8/conjure_enum.hpp>

//-----------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/fix8/conjure_enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class conjure_enum : public static_only
#endif
}

struct is_scoped : std::integral_constant<bool, requires
struct is_scoped : std::bool_constant<requires
{
requires !std::convertible_to<T, std::underlying_type_t<T>>;
}>{};
Expand Down

0 comments on commit fd07101

Please sign in to comment.