Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to Master updating to v1.1.0 #17

Merged
merged 235 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
6551a38
updated
Jul 30, 2024
d47ce58
updated
Jul 31, 2024
171067f
updated
Jul 31, 2024
fa8b280
updated
Jul 31, 2024
97d80ae
pre-rel 1.0.2a
Jul 31, 2024
1e30ae1
updated
Aug 1, 2024
d69e67b
updated
Aug 1, 2024
84957e5
updated
Aug 1, 2024
df40563
updated
Aug 1, 2024
493fd64
updated
Aug 1, 2024
72d4401
updated
Aug 1, 2024
45193a9
updated
Aug 1, 2024
2432273
updated
Aug 1, 2024
41aae76
updated
Aug 3, 2024
debf008
updated
Aug 3, 2024
120d0e1
updated
Aug 5, 2024
5a3735e
updated
Aug 5, 2024
d7ba719
updated
Aug 5, 2024
4af7a62
updated
Aug 5, 2024
f7a56dc
updated
Aug 5, 2024
17c8f07
updated
Aug 5, 2024
13d4c2a
updated
Aug 5, 2024
4d8925f
pre-rel 1.0.2b
Aug 5, 2024
88de780
updated
Aug 5, 2024
d14c09d
updated
Aug 6, 2024
fe3ae1b
updated
Aug 7, 2024
b8e95cc
updated
Aug 7, 2024
c4c6fac
updated
Aug 10, 2024
bd4ffbf
pre-rel 1.0.2c
Aug 10, 2024
35be85d
pre-rel 1.0.2c
Aug 10, 2024
a802f46
pre-rel 1.0.2c
Aug 10, 2024
810b61b
pre-rel 1.0.2c
Aug 10, 2024
0d413bf
pre-rel 1.0.2c
Aug 10, 2024
76b1528
pre-rel 1.0.2c
Aug 10, 2024
4507419
pre-rel 1.0.2c
Aug 10, 2024
1a26948
pre-rel 1.0.2c
Aug 10, 2024
adc3972
pre-rel 1.0.2c
Aug 10, 2024
72a1651
pre-rel 1.0.2c
Aug 10, 2024
c53d36d
pre-rel 1.0.2c
Aug 11, 2024
750653a
pre-rel 1.0.2d
Aug 11, 2024
1473be2
pre-rel 1.0.2d
Aug 11, 2024
5a203b9
pre-rel 1.0.2d
Aug 11, 2024
77be465
pre-rel 1.0.2d
Aug 11, 2024
df7762d
pre-rel 1.0.2d
Aug 11, 2024
225857e
pre-rel 1.0.2d
Aug 11, 2024
1afca87
pre-rel 1.0.2d
Aug 11, 2024
e1348dc
updated
Aug 11, 2024
1602a79
pre-rel 1.0.2d
Aug 11, 2024
3e49369
pre-rel 1.0.2d
Aug 12, 2024
787ec12
pre-rel 1.0.2d
Aug 12, 2024
1268fe1
pre-rel 1.0.2d
Aug 12, 2024
9dea49e
pre-rel 1.0.2d
Aug 12, 2024
8dc4015
pre-rel 1.0.2d
Aug 12, 2024
fe34324
pre-rel 1.0.2d
Aug 12, 2024
789194f
updated
Aug 12, 2024
ef927ea
updated
Aug 12, 2024
fb46f66
pre-rel 1.0.2d
Aug 12, 2024
2a287e4
pre-rel 1.0.2d
Aug 12, 2024
a50d16e
pre-rel 1.0.2d
Aug 12, 2024
c7a5161
pre-rel 1.0.2d
Aug 12, 2024
053c79c
pre-rel 1.0.2d
Aug 13, 2024
9c38a94
pre-rel 1.0.2d
Aug 13, 2024
e663c8a
pre-rel 1.0.2d
Aug 13, 2024
cd5779c
pre-rel 1.0.2d
Aug 13, 2024
d9014b9
updated
Aug 13, 2024
703ced2
updated
Aug 13, 2024
63efbfb
updated
Aug 13, 2024
66548a0
pre-rel 1.0.2d
Aug 13, 2024
360ef1d
pre-rel 1.0.2d
Aug 13, 2024
82c93a2
updated
Aug 13, 2024
040dbec
pre-rel 1.0.2d
Aug 13, 2024
adeb35a
pre-rel 1.0.2d
Aug 13, 2024
75e1f7a
pre-rel 1.0.2d
Aug 13, 2024
ce3df53
pre-rel 1.0.2d
Aug 13, 2024
2ec101b
updated
Aug 13, 2024
a42e784
updated
Aug 13, 2024
2d9b99c
pre-rel 1.0.2e
Aug 14, 2024
73b29f3
pre-rel 1.0.2d
Aug 14, 2024
c497101
pre-rel 1.0.2e
Aug 14, 2024
3d7e3d9
updated
Aug 14, 2024
cd79f2b
pre-rel 1.0.2e
Aug 14, 2024
d4fea56
pre-rel 1.0.2e
Aug 14, 2024
05063f0
pre-rel 1.0.2e
Aug 14, 2024
65e5b03
pre-rel 1.0.2e
Aug 14, 2024
63cf834
pre-rel 1.0.2e
Aug 14, 2024
391370f
pre-rel 1.0.2e
Aug 14, 2024
bccc70a
pre-rel 1.0.2e
Aug 14, 2024
741c635
pre-rel 1.0.2e
Aug 14, 2024
8931dd1
pre-rel 1.0.2e
Aug 14, 2024
34a8759
updated
Aug 15, 2024
7bcf539
updated
Aug 15, 2024
65a7566
updated
Aug 15, 2024
bb06db5
updated
Aug 15, 2024
3ae9d94
updated
Aug 15, 2024
0602a3e
updated
Aug 15, 2024
e434165
pre-rel 1.0.2e
Aug 15, 2024
d8686dd
updated
Aug 15, 2024
86a8ebb
updated
Aug 15, 2024
4775c70
updated
Aug 16, 2024
ef6915b
pre-rel 1.1.0a
Aug 16, 2024
e9fc190
updated
Aug 16, 2024
46e9f70
updated
Aug 16, 2024
c88ff48
updated
Aug 16, 2024
8a8266f
updated
Aug 16, 2024
b3e0ae9
updated
Aug 16, 2024
278680a
updated
Aug 16, 2024
740ccb6
pre-rel 1.1.0a
Aug 16, 2024
06d1737
updated
Aug 16, 2024
854ebf2
updated
Aug 16, 2024
742fb1d
updated
Aug 16, 2024
46ad8ca
updated
Aug 16, 2024
07d9167
updated
Aug 16, 2024
2f50071
updated
Aug 16, 2024
6b40661
updated
Aug 16, 2024
a32371a
updated
Aug 16, 2024
f65ec38
pre-rel 1.1.0a
Aug 16, 2024
06b44c7
updated
Aug 17, 2024
7ab4689
updated
Aug 17, 2024
c6a266c
updated
Aug 17, 2024
a16b69d
updated
Aug 17, 2024
933aad2
updated
Aug 17, 2024
7073e08
updated
Aug 17, 2024
fe7eb91
updated
Aug 17, 2024
f899e58
pre-rel 1.1.0a
Aug 17, 2024
f652bd9
updated
Aug 17, 2024
24aa4e3
updated
Aug 17, 2024
e1ce7b7
updated
Aug 17, 2024
87e8087
updated
Aug 20, 2024
d2cbc3d
updated
Aug 20, 2024
51a32f5
pre-rel 1.1b
Aug 20, 2024
f77c808
updated
Aug 20, 2024
4176b5d
updated
Aug 20, 2024
6ffb621
updated
Aug 22, 2024
26ab83e
pre-rel 1.1c
Aug 22, 2024
cba7a1b
updated
Aug 23, 2024
d1817b1
pre-rel 1.1c
Aug 23, 2024
22b4160
pre-rel 1.1c
Aug 23, 2024
d44a105
pre-rel 1.1c
Aug 23, 2024
bf036e1
pre-rel 1.1c
Aug 23, 2024
3b8d366
pre-rel 1.1c
Aug 23, 2024
95862a2
pre-rel 1.1c
Aug 23, 2024
55f243e
pre-rel 1.1c
Aug 23, 2024
4768e08
pre-rel 1.1c
Aug 23, 2024
258130a
updated
Aug 23, 2024
83d6ba3
updated
Aug 23, 2024
9996065
updated
Aug 23, 2024
cb92954
updated
Aug 23, 2024
95823e2
updated
Aug 23, 2024
0b5defa
updated
Aug 23, 2024
75f16bd
updated
Aug 23, 2024
5bdeee6
pre-rel 1.1c
Aug 24, 2024
a36f1fb
updated
Aug 24, 2024
d4a6003
updated
Aug 25, 2024
2495e47
updated
Aug 25, 2024
384b245
updated
Aug 25, 2024
45145ad
updated
Aug 25, 2024
f3ac63f
updated
Aug 25, 2024
eb9ec60
updated
Aug 25, 2024
1a362c6
updated
Aug 25, 2024
ac04be4
updated
Aug 25, 2024
617681b
updated
Aug 25, 2024
778e614
updated
Aug 25, 2024
8c851bb
updated
Aug 25, 2024
0abab94
updated
Aug 25, 2024
74a8e72
updated
Aug 25, 2024
f1107c6
updated
Aug 25, 2024
595b266
updated
Aug 25, 2024
bbbde93
updated
Aug 25, 2024
aa9e11a
updated
Aug 25, 2024
7740c10
updated
Aug 26, 2024
4f70d6b
updated
Aug 26, 2024
d06ca05
updated
Aug 26, 2024
ed68864
updated
Aug 26, 2024
9658f31
updated
Aug 27, 2024
85c82f6
pre-rel 1.1e
Aug 27, 2024
a5caa0c
updated
Aug 27, 2024
1316bc0
updated
Aug 27, 2024
0c60ff6
updated
Aug 27, 2024
8809fb2
pre-rel 1.1e
Aug 27, 2024
2adeffb
updated
Aug 27, 2024
df01413
updated
Aug 28, 2024
7017bdb
pre-rel 1.1e
Aug 28, 2024
7d5daef
updated
Aug 28, 2024
5aa524e
updated
Aug 28, 2024
1f6fa88
updated
Aug 28, 2024
ea9c880
updated
Aug 28, 2024
4f985d8
updated
Aug 28, 2024
a4ef500
updated
Aug 28, 2024
606b80a
updated
Aug 28, 2024
6801ffa
updated
Aug 28, 2024
ffbc8c6
updated
Aug 28, 2024
4c14308
updated
Aug 28, 2024
8470d5f
updated
Aug 28, 2024
baac070
updated
Aug 28, 2024
873957a
updated
Aug 28, 2024
2ff522b
updated
Aug 28, 2024
43d5f25
updated
Aug 28, 2024
960f7c1
updated
Aug 28, 2024
c68c601
updated
Aug 28, 2024
d5013fa
updated
Aug 28, 2024
c498c12
updated
Aug 28, 2024
b13a938
pre-rel 1.1e
Aug 28, 2024
ed4be65
updated
Aug 28, 2024
dd5aa17
updated
Aug 28, 2024
3e68d78
updated
Aug 28, 2024
c6e1855
updated
Aug 28, 2024
5b6d009
updated
Aug 28, 2024
38b994a
updated
Aug 28, 2024
15de40c
updated
Aug 29, 2024
cfc2276
updated
Aug 29, 2024
a697f67
updated
Aug 29, 2024
878c6f7
updated
Aug 29, 2024
3f1323c
updated
Aug 30, 2024
487f6f3
updated
Aug 30, 2024
6c61688
updated
Aug 30, 2024
bb61d76
updated
Aug 30, 2024
6557897
pre-rel 1.1f
Aug 31, 2024
2c1eb23
pre-rel 1.1f
Aug 31, 2024
cb22739
updated
Sep 1, 2024
53dba04
updated
Sep 1, 2024
7192241
updated
Sep 1, 2024
96ac45c
updated
Sep 1, 2024
342505d
updated
Sep 1, 2024
56bffd0
updated
Sep 1, 2024
8cebdbc
updated
Sep 4, 2024
4fe7c02
updated
Sep 4, 2024
b9c6a2d
pre-rel 1.1g
Sep 6, 2024
228f894
updated
Sep 6, 2024
94c22e6
updated
Sep 6, 2024
a5f1397
updated
Sep 6, 2024
85c647f
updated
Sep 6, 2024
1e97790
updated
Sep 6, 2024
3bf412a
updated
Sep 6, 2024
dfd95b4
pre-rel 1.1g
Sep 8, 2024
871b388
pre-rel 1.1g
Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,30 @@ project (conjure_enum
LANGUAGES CXX
HOMEPAGE_URL https://github.com/fix8mt/conjure_enum
DESCRIPTION "Lightweight C++20 enum and typename reflection"
VERSION 1.0.0)
VERSION 1.1.0)

message("${CMAKE_PROJECT_NAME} version ${CMAKE_PROJECT_VERSION}")

# to disable strip:
# cmake -DBUILD_STRIP_EXE=false ..
option(BUILD_STRIP_EXE "enable stripping of non-unittest executables" true)
message("-- Build strip exes: ${BUILD_STRIP_EXE}")
message("-- Build: strip exes ${BUILD_STRIP_EXE}")

# to disable warnings:
# cmake -DBUILD_ALL_WARNINGS=false ..
option(BUILD_ALL_WARNINGS "enable building with all warnings" true)
message("-- Build with all warnings : ${BUILD_ALL_WARNINGS}")
message("-- Build: with all warnings ${BUILD_ALL_WARNINGS}")

# to disable building unit tests:
# cmake -DBUILD_UNITTESTS=false ..
option(BUILD_UNITTESTS "enable building unit tests" true)
message("-- Build unit tests: ${BUILD_UNITTESTS}")
message("-- Build: unit tests ${BUILD_UNITTESTS}")

# to enable clang build profiler:
# cmake -DBUILD_CLANG_PROFILER=true ..
# see examples/cbenchmark.sh
option(BUILD_CLANG_PROFILER "enable clang build profiler" false)
message("-- Build clang profiler: ${BUILD_CLANG_PROFILER}")
message("-- Build: clang profiler ${BUILD_CLANG_PROFILER}")
if(BUILD_CLANG_PROFILER)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-ftime-trace)
Expand Down
733 changes: 611 additions & 122 deletions README.md

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions examples/cbenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,35 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//----------------------------------------------------------------------------------------
#include <system_error>
#define FIX8_CONJURE_ENUM_MINIMAL
// CLI msvc build benchmark from your build dir
// call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
// cl /nologo /MD /std:c++latest /Bt+ /I ..\include ..\examples\cbenchmark.cpp|find "c1xx.dll"
//----------------------------------------------------------------------------------------
#define FIX8_CONJURE_ENUM_ALL_OPTIMIZATIONS
#include <fix8/conjure_enum.hpp>

//-----------------------------------------------------------------------------------------
FIX8_CONJURE_ENUM_SET_RANGE_INTS(std::errc, 0, 71)
enum class numbers
{
zero, one, two, three, four,
five, six, seven, eight, nine,
ten, eleven, twelve, thirteen, fourteen,
fifteen, sixteen, seventeen, eighteen, nineteen,
twenty, twenty_one, twenty_two, twenty_three, twenty_four,
twenty_five, twenty_six, twenty_seven, twenty_eight, twenty_nine,
thirty, thirty_one, thirty_two, thirty_three, thirty_four,
thirty_five, thirty_six, thirty_seven, thirty_eight, thirty_nine,
forty, forty_one, forty_two, forty_three, forty_four,
forty_five, forty_six, forty_seven, forty_eight, forty_nine,
fifty, fifty_one, fifty_two, fifty_three, fifty_four,
fifty_five, fifty_six, fifty_seven, fifty_eight, fifty_nine,
sixty, sixty_one, sixty_two, sixty_three
};
FIX8_CONJURE_ENUM_SET_RANGE(numbers::zero, numbers::sixty_three);

int test_conjure_enum(std::errc err)
auto test_conjure_enum(numbers num)
{
return FIX8::conjure_enum<std::errc>::enum_to_string(err).size();
return FIX8::conjure_enum<numbers>::enum_to_string(num).size();
}

int main(void)
Expand Down
31 changes: 31 additions & 0 deletions examples/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#endif

#include <fix8/conjure_enum.hpp>
#include <fix8/conjure_enum_bitset.hpp>
#include <fix8/conjure_type.hpp>

//-----------------------------------------------------------------------------------------
using namespace std::literals::string_view_literals;
Expand All @@ -52,6 +54,24 @@ enum component1 : int { scheme, authority, userinfo, user, password, host, port,
enum class numbers : int { zero, one, two, three, four, five, six, seven, eight, nine };
enum class numbers1 : int { zero1=4, one1=3, two1=2, three1, four1, five1, six1, seven1, eight1, nine1 };

//-----------------------------------------------------------------------------------------
struct foo1
{
int process(component val, int aint) const
{
return aint * static_cast<int>(val);
}
static constexpr auto dd2a
{
std::to_array<std::tuple<component, int (foo1::*)(component, int) const>>
({
{ component::scheme, &foo1::process },
{ component::port, &foo1::process },
{ component::fragment, &foo1::process },
})
};
};

//-----------------------------------------------------------------------------------------
template<typename T>
const std::string demangle() noexcept
Expand All @@ -71,6 +91,7 @@ const std::string demangle() noexcept
return typeid(T).name();
}

//-----------------------------------------------------------------------------------------
int main(void)
{
conjure_enum<component>::for_each_n(3, [](component val, int other) { std::cout << static_cast<int>(val) << ' ' << other << '\n'; }, 200);
Expand Down Expand Up @@ -226,5 +247,15 @@ int main(void)
std::cout << '"' << component::host << '"' << '\n';
std::cout << '"' << component1::host << '"' << '\n';
std::cout << '"' << static_cast<component>(100) << '"' << '\n';

std::cout << std::hash<enum_bitset<numbers>>{}(er) << '\n';

foo1 bar1;
std::cout << conjure_enum<component>::dispatch(component::port, -1, foo1::dd2a, &bar1, 1000) << '\n';

using en = conjure_enum<numbers>;
for (const auto& [ev,str] : {en::front(), en::back()})
std::cout << static_cast<int>(ev) << ' ' << str << '\n';

return 0;
}
6 changes: 3 additions & 3 deletions examples/srcloctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ int main(int argc, char **argv)
};

bool mkd{}, cpl{true}, hlp{};
std::map<std::string_view, bool&> opts { {"-m",mkd},{"-c",cpl},{"-h",hlp} };
for (int ii{1}; ii < argc; ++ii)
if (auto result{opts.find(std::string_view(argv[ii]))}; result != opts.cend())
const std::map<std::string_view, bool&> opts { {"-m",mkd},{"-c",cpl},{"-h",hlp} };
for (const std::vector<std::string_view> args{argv + 1, argv + argc}; const auto pp : args)
if (auto result{opts.find(pp)}; result != opts.cend())
result->second ^= true;
if (hlp)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/statictest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ int main(void)
{
for(const auto& [a, b] : conjure_enum<component>::entries)
std::cout << conjure_enum<component>::enum_to_int(a) << ' ' << b << '\n';
for(const auto& a : conjure_enum<component>::names)
std::cout << a << '\n';
std::cout << static_cast<int>(conjure_enum<component>::string_to_enum("component::path").value()) << '\n';
std::cout << conjure_enum<component>::get_enum_min_value() << '/' << conjure_enum<component>::get_enum_max_value() << '\n';
return 0;
Expand Down
Loading