diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-14 10:19:40 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-14 10:42:27 -0500 |
commit | e4fe5974f123cfba6d8eff908e7f1772b0b9635f (patch) | |
tree | 69477cee57289107f2081eafecb95ffbcb4c47fa /lib/statement.cpp | |
parent | 2f938ddd17190497e21194a0ef3e1cfa14f68943 (diff) | |
download | verbly-e4fe5974f123cfba6d8eff908e7f1772b0b9635f.tar.gz verbly-e4fe5974f123cfba6d8eff908e7f1772b0b9635f.tar.bz2 verbly-e4fe5974f123cfba6d8eff908e7f1772b0b9635f.zip |
Migrate from mpark::variant to std::variant
Diffstat (limited to 'lib/statement.cpp')
-rw-r--r-- | lib/statement.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/statement.cpp b/lib/statement.cpp index 669dc2a..3440acb 100644 --- a/lib/statement.cpp +++ b/lib/statement.cpp | |||
@@ -800,7 +800,7 @@ namespace verbly { | |||
800 | 800 | ||
801 | case type::singleton: | 801 | case type::singleton: |
802 | { | 802 | { |
803 | const singleton_type& singleton = mpark::get<singleton_type>(variant_); | 803 | const singleton_type& singleton = std::get<singleton_type>(variant_); |
804 | 804 | ||
805 | sql << singleton.table << "." << singleton.column; | 805 | sql << singleton.table << "." << singleton.column; |
806 | 806 | ||
@@ -816,20 +816,20 @@ namespace verbly { | |||
816 | sql << " != "; | 816 | sql << " != "; |
817 | } | 817 | } |
818 | 818 | ||
819 | if (mpark::holds_alternative<field_binding>(singleton.value)) | 819 | if (std::holds_alternative<field_binding>(singleton.value)) |
820 | { | 820 | { |
821 | sql << std::get<0>(mpark::get<field_binding>(singleton.value)) | 821 | sql << std::get<0>(std::get<field_binding>(singleton.value)) |
822 | << "." | 822 | << "." |
823 | << std::get<1>(mpark::get<field_binding>(singleton.value)); | 823 | << std::get<1>(std::get<field_binding>(singleton.value)); |
824 | } else if (debug) | 824 | } else if (debug) |
825 | { | 825 | { |
826 | if (mpark::holds_alternative<std::string>(singleton.value)) | 826 | if (std::holds_alternative<std::string>(singleton.value)) |
827 | { | 827 | { |
828 | sql << "\"" << mpark::get<std::string>(singleton.value) << "\""; | 828 | sql << "\"" << std::get<std::string>(singleton.value) << "\""; |
829 | } | 829 | } |
830 | else if (mpark::holds_alternative<int>(singleton.value)) | 830 | else if (std::holds_alternative<int>(singleton.value)) |
831 | { | 831 | { |
832 | sql << mpark::get<int>(singleton.value); | 832 | sql << std::get<int>(singleton.value); |
833 | } | 833 | } |
834 | } else { | 834 | } else { |
835 | sql << "?"; | 835 | sql << "?"; |
@@ -844,7 +844,7 @@ namespace verbly { | |||
844 | 844 | ||
845 | if (debug) | 845 | if (debug) |
846 | { | 846 | { |
847 | sql << mpark::get<int>(singleton.value); | 847 | sql << std::get<int>(singleton.value); |
848 | } else { | 848 | } else { |
849 | sql << "?"; | 849 | sql << "?"; |
850 | } | 850 | } |
@@ -858,7 +858,7 @@ namespace verbly { | |||
858 | 858 | ||
859 | if (debug) | 859 | if (debug) |
860 | { | 860 | { |
861 | sql << mpark::get<int>(singleton.value); | 861 | sql << std::get<int>(singleton.value); |
862 | } else { | 862 | } else { |
863 | sql << "?"; | 863 | sql << "?"; |
864 | } | 864 | } |
@@ -872,7 +872,7 @@ namespace verbly { | |||
872 | 872 | ||
873 | if (debug) | 873 | if (debug) |
874 | { | 874 | { |
875 | sql << mpark::get<int>(singleton.value); | 875 | sql << std::get<int>(singleton.value); |
876 | } else { | 876 | } else { |
877 | sql << "?"; | 877 | sql << "?"; |
878 | } | 878 | } |
@@ -886,7 +886,7 @@ namespace verbly { | |||
886 | 886 | ||
887 | if (debug) | 887 | if (debug) |
888 | { | 888 | { |
889 | sql << mpark::get<int>(singleton.value); | 889 | sql << std::get<int>(singleton.value); |
890 | } else { | 890 | } else { |
891 | sql << "?"; | 891 | sql << "?"; |
892 | } | 892 | } |
@@ -900,7 +900,7 @@ namespace verbly { | |||
900 | 900 | ||
901 | if (debug) | 901 | if (debug) |
902 | { | 902 | { |
903 | sql << "\"" << mpark::get<std::string>(singleton.value) << "\""; | 903 | sql << "\"" << std::get<std::string>(singleton.value) << "\""; |
904 | } else { | 904 | } else { |
905 | sql << "?"; | 905 | sql << "?"; |
906 | } | 906 | } |
@@ -914,7 +914,7 @@ namespace verbly { | |||
914 | 914 | ||
915 | if (debug) | 915 | if (debug) |
916 | { | 916 | { |
917 | sql << "\"" << mpark::get<std::string>(singleton.value) << "\""; | 917 | sql << "\"" << std::get<std::string>(singleton.value) << "\""; |
918 | } else { | 918 | } else { |
919 | sql << "?"; | 919 | sql << "?"; |
920 | } | 920 | } |
@@ -942,7 +942,7 @@ namespace verbly { | |||
942 | 942 | ||
943 | case type::group: | 943 | case type::group: |
944 | { | 944 | { |
945 | const group_type& group = mpark::get<group_type>(variant_); | 945 | const group_type& group = std::get<group_type>(variant_); |
946 | 946 | ||
947 | std::list<std::string> clauses; | 947 | std::list<std::string> clauses; |
948 | for (const condition& cond : group.children) | 948 | for (const condition& cond : group.children) |
@@ -990,14 +990,14 @@ namespace verbly { | |||
990 | 990 | ||
991 | case type::singleton: | 991 | case type::singleton: |
992 | { | 992 | { |
993 | const singleton_type& singleton = mpark::get<singleton_type>(variant_); | 993 | const singleton_type& singleton = std::get<singleton_type>(variant_); |
994 | 994 | ||
995 | if (mpark::holds_alternative<std::string>(singleton.value)) | 995 | if (std::holds_alternative<std::string>(singleton.value)) |
996 | { | 996 | { |
997 | return {{ mpark::get<std::string>(singleton.value) }}; | 997 | return {{ std::get<std::string>(singleton.value) }}; |
998 | } else if (mpark::holds_alternative<int>(singleton.value)) | 998 | } else if (std::holds_alternative<int>(singleton.value)) |
999 | { | 999 | { |
1000 | return {{ mpark::get<int>(singleton.value) }}; | 1000 | return {{ std::get<int>(singleton.value) }}; |
1001 | } else { | 1001 | } else { |
1002 | return {}; | 1002 | return {}; |
1003 | } | 1003 | } |
@@ -1005,7 +1005,7 @@ namespace verbly { | |||
1005 | 1005 | ||
1006 | case type::group: | 1006 | case type::group: |
1007 | { | 1007 | { |
1008 | const group_type& group = mpark::get<group_type>(variant_); | 1008 | const group_type& group = std::get<group_type>(variant_); |
1009 | 1009 | ||
1010 | std::list<hatkirby::binding> bindings; | 1010 | std::list<hatkirby::binding> bindings; |
1011 | for (const condition& cond : group.children) | 1011 | for (const condition& cond : group.children) |
@@ -1035,7 +1035,7 @@ namespace verbly { | |||
1035 | throw std::domain_error("Cannot add condition to non-group condition"); | 1035 | throw std::domain_error("Cannot add condition to non-group condition"); |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | group_type& group = mpark::get<group_type>(variant_); | 1038 | group_type& group = std::get<group_type>(variant_); |
1039 | group.children.emplace_back(std::move(n)); | 1039 | group.children.emplace_back(std::move(n)); |
1040 | 1040 | ||
1041 | return *this; | 1041 | return *this; |
@@ -1082,7 +1082,7 @@ namespace verbly { | |||
1082 | throw std::domain_error("Cannot get children of non-group condition"); | 1082 | throw std::domain_error("Cannot get children of non-group condition"); |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | const group_type& group = mpark::get<group_type>(variant_); | 1085 | const group_type& group = std::get<group_type>(variant_); |
1086 | 1086 | ||
1087 | return group.children; | 1087 | return group.children; |
1088 | } | 1088 | } |
@@ -1099,7 +1099,7 @@ namespace verbly { | |||
1099 | 1099 | ||
1100 | case type::group: | 1100 | case type::group: |
1101 | { | 1101 | { |
1102 | const group_type& group = mpark::get<group_type>(variant_); | 1102 | const group_type& group = std::get<group_type>(variant_); |
1103 | 1103 | ||
1104 | condition result(group.orlogic); | 1104 | condition result(group.orlogic); |
1105 | 1105 | ||
@@ -1110,7 +1110,7 @@ namespace verbly { | |||
1110 | if (newChild.type_ == type::group) | 1110 | if (newChild.type_ == type::group) |
1111 | { | 1111 | { |
1112 | group_type& childGroup = | 1112 | group_type& childGroup = |
1113 | mpark::get<group_type>(newChild.variant_); | 1113 | std::get<group_type>(newChild.variant_); |
1114 | 1114 | ||
1115 | if (childGroup.orlogic == group.orlogic) | 1115 | if (childGroup.orlogic == group.orlogic) |
1116 | { | 1116 | { |
@@ -1144,7 +1144,7 @@ namespace verbly { | |||
1144 | 1144 | ||
1145 | case type::singleton: | 1145 | case type::singleton: |
1146 | { | 1146 | { |
1147 | const singleton_type& singleton = mpark::get<singleton_type>(variant_); | 1147 | const singleton_type& singleton = std::get<singleton_type>(variant_); |
1148 | 1148 | ||
1149 | if (singleton.parentObject != object::undefined && | 1149 | if (singleton.parentObject != object::undefined && |
1150 | singleton.parentObject == context) | 1150 | singleton.parentObject == context) |
@@ -1155,7 +1155,7 @@ namespace verbly { | |||
1155 | singleton.comparison, | 1155 | singleton.comparison, |
1156 | field_binding { | 1156 | field_binding { |
1157 | tableName, | 1157 | tableName, |
1158 | std::get<1>(mpark::get<field_binding>(singleton.value)) | 1158 | std::get<1>(std::get<field_binding>(singleton.value)) |
1159 | } | 1159 | } |
1160 | }; | 1160 | }; |
1161 | } else { | 1161 | } else { |
@@ -1165,7 +1165,7 @@ namespace verbly { | |||
1165 | 1165 | ||
1166 | case type::group: | 1166 | case type::group: |
1167 | { | 1167 | { |
1168 | const group_type& group = mpark::get<group_type>(variant_); | 1168 | const group_type& group = std::get<group_type>(variant_); |
1169 | 1169 | ||
1170 | condition result(group.orlogic); | 1170 | condition result(group.orlogic); |
1171 | for (const condition& cond : group.children) | 1171 | for (const condition& cond : group.children) |