diff --git a/navtreedata.js b/navtreedata.js index a805340de..01668eb0f 100644 --- a/navtreedata.js +++ b/navtreedata.js @@ -187,12 +187,12 @@ var NAVTREE = var NAVTREEINDEX = [ -"annotated.html", -"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#aef6872e07743217fe2e2abe790a21d4c", -"classsimdjson_1_1dom_1_1object_1_1iterator.html#a83b3c467632c017400f95ff05d2367b3", -"logger-inl_8h.html#aa220611a86e2a544368f650b7f7315fb", -"ondemand-inl_8h_source.html", -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#af882bb9212c81253b2f52ae763f1fab6" +"", +"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae0bc6b9803e0c989e9defaf3edcaaae4", +"classsimdjson_1_1dom_1_1object_1_1iterator.html#a5c80355d967cce16eab942a8d8351c7b", +"logger-inl_8h.html#a6ca1434e6fe03e97dbc88360cc6ea5db", +"namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#af941be7ff0cfaeb30d15d2fb52e76dd1", +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#abdd158d04a924752c33bb54af46608e4" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/navtreeindex0.js b/navtreeindex0.js index ef8f1df49..c5186077d 100644 --- a/navtreeindex0.js +++ b/navtreeindex0.js @@ -1,5 +1,9 @@ var NAVTREEINDEX0 = { +"":[10,0,0,0], +"":[10,0,0,1], +"":[10,0,1], +"":[10,0,0,1,0,0], "annotated.html":[11,0], "arm64_2begin_8h_source.html":[12,0,0,0,0,0], "arm64_2bitmanipulation_8h_source.html":[12,0,0,0,0,1], @@ -245,9 +249,5 @@ var NAVTREEINDEX0 = "classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ad210f9115679a625ada433add55eff51":[11,0,0,1,0,7,12], "classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ad742392a9223e096f1be16b7bbf20ca8":[11,0,0,1,0,7,6], "classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#adbe7322f665109b9816c5bcb9c10a9cb":[11,0,0,1,0,7,10], -"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#add102ee85423a75e22e4d7ca9a3eaacd":[11,0,0,1,0,7,4], -"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae0bc6b9803e0c989e9defaf3edcaaae4":[11,0,0,1,0,7,16], -"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae3d80f8e7f31c319fe6ee09c0860df83":[11,0,0,1,0,7,2], -"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae5cda98fa74051d037c0c444c67efb15":[11,0,0,1,0,7,19], -"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#aeb4a70edd1808f36210460ed410e8dae":[11,0,0,1,0,7,3] +"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#add102ee85423a75e22e4d7ca9a3eaacd":[11,0,0,1,0,7,4] }; diff --git a/navtreeindex1.js b/navtreeindex1.js index 1df96e75e..7444291f3 100644 --- a/navtreeindex1.js +++ b/navtreeindex1.js @@ -1,5 +1,9 @@ var NAVTREEINDEX1 = { +"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae0bc6b9803e0c989e9defaf3edcaaae4":[11,0,0,1,0,7,16], +"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae3d80f8e7f31c319fe6ee09c0860df83":[11,0,0,1,0,7,2], +"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#ae5cda98fa74051d037c0c444c67efb15":[11,0,0,1,0,7,19], +"classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#aeb4a70edd1808f36210460ed410e8dae":[11,0,0,1,0,7,3], "classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#aef6872e07743217fe2e2abe790a21d4c":[11,0,0,1,0,7,5], "classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object.html#affa38e7fd0778672e7dd02916a97ad21":[11,0,0,1,0,7,9], "classsimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object__iterator.html":[11,0,0,1,0,8], @@ -245,9 +249,5 @@ var NAVTREEINDEX1 = "classsimdjson_1_1dom_1_1object_1_1iterator.html#a4807eeb1ed5f596b587d0b61dfb550e7":[11,0,0,0,4,0,6], "classsimdjson_1_1dom_1_1object_1_1iterator.html#a498ffa7fca4164634f87ff2ef0905f8b":[11,0,0,0,4,0,14], "classsimdjson_1_1dom_1_1object_1_1iterator.html#a54a99dcf9c422d5c24f3c570b6d9b6e4":[11,0,0,0,4,0,5], -"classsimdjson_1_1dom_1_1object_1_1iterator.html#a5ad1b60fd5df56d9fdb8bce1e08de88f":[11,0,0,0,4,0,8], -"classsimdjson_1_1dom_1_1object_1_1iterator.html#a5c80355d967cce16eab942a8d8351c7b":[11,0,0,0,4,0,2], -"classsimdjson_1_1dom_1_1object_1_1iterator.html#a688f6c7f451602bb3385a93252c0828a":[11,0,0,0,4,0,10], -"classsimdjson_1_1dom_1_1object_1_1iterator.html#a6d335de77b8c5b731566e48f6cacd95d":[11,0,0,0,4,0,7], -"classsimdjson_1_1dom_1_1object_1_1iterator.html#a7b4a7d3017744fec3aa4252967f73204":[11,0,0,0,4,0,16] +"classsimdjson_1_1dom_1_1object_1_1iterator.html#a5ad1b60fd5df56d9fdb8bce1e08de88f":[11,0,0,0,4,0,8] }; diff --git a/navtreeindex2.js b/navtreeindex2.js index c3f86bdf2..e4bf7cf43 100644 --- a/navtreeindex2.js +++ b/navtreeindex2.js @@ -1,5 +1,9 @@ var NAVTREEINDEX2 = { +"classsimdjson_1_1dom_1_1object_1_1iterator.html#a5c80355d967cce16eab942a8d8351c7b":[11,0,0,0,4,0,2], +"classsimdjson_1_1dom_1_1object_1_1iterator.html#a688f6c7f451602bb3385a93252c0828a":[11,0,0,0,4,0,10], +"classsimdjson_1_1dom_1_1object_1_1iterator.html#a6d335de77b8c5b731566e48f6cacd95d":[11,0,0,0,4,0,7], +"classsimdjson_1_1dom_1_1object_1_1iterator.html#a7b4a7d3017744fec3aa4252967f73204":[11,0,0,0,4,0,16], "classsimdjson_1_1dom_1_1object_1_1iterator.html#a83b3c467632c017400f95ff05d2367b3":[11,0,0,0,4,0,12], "classsimdjson_1_1dom_1_1object_1_1iterator.html#a951609ca7a164b499ff19adbe2de7983":[11,0,0,0,4,0,4], "classsimdjson_1_1dom_1_1object_1_1iterator.html#a9f49fe89534f63d3d2543d5d4bad3180":[11,0,0,0,4,0,1], @@ -245,9 +249,5 @@ var NAVTREEINDEX2 = "logger-inl_8h.html#a1b9952154ae0172530a16854ff005d92":[10,0,0,1,0,0,14], "logger-inl_8h.html#a273e5f25cfdef1064a5225a47d85eb4f":[10,0,0,1,0,0,2], "logger-inl_8h.html#a4427c475cf7d49b372c768201b4d92cb":[10,0,0,1,0,0,6], -"logger-inl_8h.html#a66e3122a7ae01bfe5f81ecb1bf1814cc":[10,0,0,1,0,0,4], -"logger-inl_8h.html#a6ca1434e6fe03e97dbc88360cc6ea5db":[10,0,0,1,0,0,1], -"logger-inl_8h.html#a720bb462b108c1f9bcaa02cdcdfe6546":[10,0,0,1,0,0,12], -"logger-inl_8h.html#a7577e5a0dcaf23edf36d162959680a7c":[10,0,0,1,0,0,8], -"logger-inl_8h.html#a92b499d3d191a02e913f90de4f641e2e":[10,0,0,1,0,0,10] +"logger-inl_8h.html#a66e3122a7ae01bfe5f81ecb1bf1814cc":[10,0,0,1,0,0,4] }; diff --git a/navtreeindex3.js b/navtreeindex3.js index bcd5daf4f..d07d4de07 100644 --- a/navtreeindex3.js +++ b/navtreeindex3.js @@ -1,5 +1,9 @@ var NAVTREEINDEX3 = { +"logger-inl_8h.html#a6ca1434e6fe03e97dbc88360cc6ea5db":[10,0,0,1,0,0,1], +"logger-inl_8h.html#a720bb462b108c1f9bcaa02cdcdfe6546":[10,0,0,1,0,0,12], +"logger-inl_8h.html#a7577e5a0dcaf23edf36d162959680a7c":[10,0,0,1,0,0,8], +"logger-inl_8h.html#a92b499d3d191a02e913f90de4f641e2e":[10,0,0,1,0,0,10], "logger-inl_8h.html#aa220611a86e2a544368f650b7f7315fb":[10,0,0,1,0,0,3], "logger-inl_8h.html#aaa4c1a2ef6eb08bb02a8ea6e49d2a786":[10,0,0,1,0,0,11], "logger-inl_8h.html#ab8082fd58a3d7e115016a3fc52ee8936":[10,0,0,1,0,0,0], @@ -245,9 +249,5 @@ var NAVTREEINDEX3 = "namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#ac915f0c06e5ab0363e09593bba651330ab45cffe084dd3d20d928bee85e7b0f21":[10,0,0,1,0,15,3], "namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#ac915f0c06e5ab0363e09593bba651330af1f713c9e000f5d3f280adbd124df4f5":[10,0,0,1,0,15,0], "namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#adab1063af10b90a1f45f87b307225995":[10,0,0,1,0,28], -"namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#ae52a82c2f754a47eb9dac12223b3311d":[10,0,0,1,0,25], -"namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#af941be7ff0cfaeb30d15d2fb52e76dd1":[10,0,0,1,0,13], -"numberparsing__tables_8h_source.html":[12,0,0,0,6,4], -"object__iterator-inl_8h_source.html":[12,0,0,0,3,0,18], -"object__iterator_8h_source.html":[12,0,0,0,3,0,19] +"namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#ae52a82c2f754a47eb9dac12223b3311d":[10,0,0,1,0,25] }; diff --git a/navtreeindex4.js b/navtreeindex4.js index cfa9e0f41..7ae857691 100644 --- a/navtreeindex4.js +++ b/navtreeindex4.js @@ -1,5 +1,9 @@ var NAVTREEINDEX4 = { +"namespacesimdjson_1_1_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand.html#af941be7ff0cfaeb30d15d2fb52e76dd1":[10,0,0,1,0,13], +"numberparsing__tables_8h_source.html":[12,0,0,0,6,4], +"object__iterator-inl_8h_source.html":[12,0,0,0,3,0,18], +"object__iterator_8h_source.html":[12,0,0,0,3,0,19], "ondemand-inl_8h_source.html":[12,0,0,0,3,7], "ondemand_8h_source.html":[12,0,0,0,3,8], "padded__string-inl_8h_source.html":[12,0,0,0,26], @@ -142,8 +146,8 @@ var NAVTREEINDEX4 = "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a567b835f20e2f854f4303e83f4d3bd74":[11,0,0,10,13], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a59a47cbdb4c226a7d33e0315cce62984":[11,0,0,10,41], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a5a4d779ce258cac95b1799f16b49695b":[11,0,0,10,48], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a6024d17789cc49d3147445b3def018f6":[11,0,0,10,22], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a6024d17789cc49d3147445b3def018f6":[11,0,0,10,23], +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a6024d17789cc49d3147445b3def018f6":[11,0,0,10,22], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a61c56912d76a1a730e4cf9b5aea5d69f":[11,0,0,10,38], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a662ec28f78a9fcba046eaa4509efa6a3":[11,0,0,10,42], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#a696390da51f64f6955aa43484b2e8c41":[11,0,0,10,28], @@ -168,10 +172,10 @@ var NAVTREEINDEX4 = "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ac994a43ba5e7fbde29d82c8d437c5fb7":[11,0,0,10,52], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ad2c7498f364cf7803f83408a8629a5ac":[11,0,0,10,46], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ad93b76ab3636d40ce75059e0f8653c6f":[11,0,0,10,8], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ada47799dcb5e64e43851d78d346b1d47":[11,0,0,10,24], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ada47799dcb5e64e43851d78d346b1d47":[11,0,0,10,25], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#adb70072b98e8c3c650ce695f3e928e66":[11,0,0,10,14], +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ada47799dcb5e64e43851d78d346b1d47":[11,0,0,10,24], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#adb70072b98e8c3c650ce695f3e928e66":[11,0,0,10,16], +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#adb70072b98e8c3c650ce695f3e928e66":[11,0,0,10,14], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#ae69c9218f418dab3b1aafeb2b6504fab":[11,0,0,10,55], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#aecc254ac74f3ccd0704813be27c98470":[11,0,0,10,9], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1document_01_4.html#aeda745db35d2b64a7956a70872242fcb":[11,0,0,10,44], @@ -245,9 +249,5 @@ var NAVTREEINDEX4 = "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#a859a70452db187eaaca4ff018f959175":[11,0,0,16,12], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#a86945d1c1c36bc51dd8a18e8ee9c0c18":[11,0,0,16,2], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#a99b1f71b33c2977afe8de124f2f662b6":[11,0,0,16,7], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#a9a5596c92c725e98767e76733fa704ac":[11,0,0,16,11], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#abdd158d04a924752c33bb54af46608e4":[11,0,0,16,0], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#ad40a8df1162007a8db15ff061fd0e083":[11,0,0,16,6], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#ad88110fe0070d8e28e680cbdbff198cf":[11,0,0,16,10], -"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#ae44a332b47352441d29290237942bee4":[11,0,0,16,8] +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#a9a5596c92c725e98767e76733fa704ac":[11,0,0,16,11] }; diff --git a/navtreeindex5.js b/navtreeindex5.js index aafce201c..51a3537c5 100644 --- a/navtreeindex5.js +++ b/navtreeindex5.js @@ -1,5 +1,9 @@ var NAVTREEINDEX5 = { +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#abdd158d04a924752c33bb54af46608e4":[11,0,0,16,0], +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#ad40a8df1162007a8db15ff061fd0e083":[11,0,0,16,6], +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#ad88110fe0070d8e28e680cbdbff198cf":[11,0,0,16,10], +"structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#ae44a332b47352441d29290237942bee4":[11,0,0,16,8], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#af882bb9212c81253b2f52ae763f1fab6":[11,0,0,16,3], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object_01_4.html#afd9f79244804cad8a3c12053c2e5da6f":[11,0,0,16,5], "structsimdjson_1_1simdjson__result_3_01_s_i_m_d_j_s_o_n___i_m_p_l_e_m_e_n_t_a_t_i_o_n_1_1ondemand_1_1object__iterator_01_4.html":[11,0,0,17], @@ -144,9 +148,5 @@ var NAVTREEINDEX5 = "westmere_2numberparsing_8h_source.html":[12,0,0,0,9,6], "westmere_2simd_8h_source.html":[12,0,0,0,9,7], "westmere_2stringparsing_8h_source.html":[12,0,0,0,9,8], -"westmere_8h_source.html":[12,0,0,0,34], -"":[10,0,0,0], -"":[10,0,0,1], -"":[10,0,1], -"":[10,0,0,1,0,0] +"westmere_8h_source.html":[12,0,0,0,34] }; diff --git a/string__view_8hpp_source.html b/string__view_8hpp_source.html index 020ba3063..89b341c25 100644 --- a/string__view_8hpp_source.html +++ b/string__view_8hpp_source.html @@ -105,7 +105,7 @@ $(document).ready(function(){initNavTree('string__view_8hpp_source.html',''); in
12 #define NONSTD_SV_LITE_H_INCLUDED
13 
14 #define string_view_lite_MAJOR 1
-
15 #define string_view_lite_MINOR 6
+
15 #define string_view_lite_MINOR 7
16 #define string_view_lite_PATCH 0
17 
18 #define string_view_lite_VERSION nssv_STRINGIFY(string_view_lite_MAJOR) "." nssv_STRINGIFY(string_view_lite_MINOR) "." nssv_STRINGIFY(string_view_lite_PATCH)
@@ -165,7 +165,7 @@ $(document).ready(function(){initNavTree('string__view_8hpp_source.html',''); in
72 // Control presence of exception handling (try and auto discover):
73 
74 #ifndef nssv_CONFIG_NO_EXCEPTIONS
-
75 # if _MSC_VER
+
75 # if defined(_MSC_VER)
76 # include <cstddef> // for _HAS_EXCEPTIONS
77 # endif
78 # if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || (_HAS_EXCEPTIONS)
@@ -175,7 +175,7 @@ $(document).ready(function(){initNavTree('string__view_8hpp_source.html',''); in
82 # endif
83 #endif
84 
-
85 // C++ language version detection (C++20 is speculative):
+
85 // C++ language version detection (C++23 is speculative):
86 // Note: VC14.0/1900 (VS2015) lacks too much from C++14.
87 
88 #ifndef nssv_CPLUSPLUS
@@ -191,1544 +191,1590 @@ $(document).ready(function(){initNavTree('string__view_8hpp_source.html',''); in
98 #define nssv_CPP11_OR_GREATER_ ( nssv_CPLUSPLUS >= 201103L )
99 #define nssv_CPP14_OR_GREATER ( nssv_CPLUSPLUS >= 201402L )
100 #define nssv_CPP17_OR_GREATER ( nssv_CPLUSPLUS >= 201703L )
-
101 #define nssv_CPP20_OR_GREATER ( nssv_CPLUSPLUS >= 202000L )
-
102 
-
103 // use C++17 std::string_view if available and requested:
-
104 
-
105 #if nssv_CPP17_OR_GREATER && defined(__has_include )
-
106 # if __has_include( <string_view> )
-
107 # define nssv_HAVE_STD_STRING_VIEW 1
-
108 # else
-
109 # define nssv_HAVE_STD_STRING_VIEW 0
-
110 # endif
-
111 #else
-
112 # define nssv_HAVE_STD_STRING_VIEW 0
-
113 #endif
-
114 
-
115 #define nssv_USES_STD_STRING_VIEW ( (nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_STD) || ((nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_DEFAULT) && nssv_HAVE_STD_STRING_VIEW) )
-
116 
-
117 #define nssv_HAVE_STARTS_WITH ( nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW )
-
118 #define nssv_HAVE_ENDS_WITH nssv_HAVE_STARTS_WITH
-
119 
-
120 //
-
121 // Use C++17 std::string_view:
-
122 //
-
123 
-
124 #if nssv_USES_STD_STRING_VIEW
-
125 
-
126 #include <string_view>
-
127 
-
128 // Extensions for std::string:
-
129 
-
130 #if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
-
131 
-
132 namespace nonstd {
-
133 
-
134 template< class CharT, class Traits, class Allocator = std::allocator<CharT> >
-
135 std::basic_string<CharT, Traits, Allocator>
-
136 to_string( std::basic_string_view<CharT, Traits> v, Allocator const & a = Allocator() )
-
137 {
-
138  return std::basic_string<CharT,Traits, Allocator>( v.begin(), v.end(), a );
-
139 }
-
140 
-
141 template< class CharT, class Traits, class Allocator >
-
142 std::basic_string_view<CharT, Traits>
-
143 to_string_view( std::basic_string<CharT, Traits, Allocator> const & s )
-
144 {
-
145  return std::basic_string_view<CharT, Traits>( s.data(), s.size() );
-
146 }
-
147 
-
148 // Literal operators sv and _sv:
-
149 
-
150 #if nssv_CONFIG_STD_SV_OPERATOR
-
151 
-
152 using namespace std::literals::string_view_literals;
-
153 
-
154 #endif
-
155 
-
156 #if nssv_CONFIG_USR_SV_OPERATOR
-
157 
-
158 inline namespace literals {
-
159 inline namespace string_view_literals {
-
160 
+
101 #define nssv_CPP20_OR_GREATER ( nssv_CPLUSPLUS >= 202002L )
+
102 #define nssv_CPP23_OR_GREATER ( nssv_CPLUSPLUS >= 202300L )
+
103 
+
104 // use C++17 std::string_view if available and requested:
+
105 
+
106 #if nssv_CPP17_OR_GREATER && defined(__has_include )
+
107 # if __has_include( <string_view> )
+
108 # define nssv_HAVE_STD_STRING_VIEW 1
+
109 # else
+
110 # define nssv_HAVE_STD_STRING_VIEW 0
+
111 # endif
+
112 #else
+
113 # define nssv_HAVE_STD_STRING_VIEW 0
+
114 #endif
+
115 
+
116 #define nssv_USES_STD_STRING_VIEW ( (nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_STD) || ((nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_DEFAULT) && nssv_HAVE_STD_STRING_VIEW) )
+
117 
+
118 #define nssv_HAVE_STARTS_WITH ( nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW )
+
119 #define nssv_HAVE_ENDS_WITH nssv_HAVE_STARTS_WITH
+
120 
+
121 //
+
122 // Use C++17 std::string_view:
+
123 //
+
124 
+
125 #if nssv_USES_STD_STRING_VIEW
+
126 
+
127 #include <string_view>
+
128 
+
129 // Extensions for std::string:
+
130 
+
131 #if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
+
132 
+
133 namespace nonstd {
+
134 
+
135 template< class CharT, class Traits, class Allocator = std::allocator<CharT> >
+
136 std::basic_string<CharT, Traits, Allocator>
+
137 to_string( std::basic_string_view<CharT, Traits> v, Allocator const & a = Allocator() )
+
138 {
+
139  return std::basic_string<CharT,Traits, Allocator>( v.begin(), v.end(), a );
+
140 }
+
141 
+
142 template< class CharT, class Traits, class Allocator >
+
143 std::basic_string_view<CharT, Traits>
+
144 to_string_view( std::basic_string<CharT, Traits, Allocator> const & s )
+
145 {
+
146  return std::basic_string_view<CharT, Traits>( s.data(), s.size() );
+
147 }
+
148 
+
149 // Literal operators sv and _sv:
+
150 
+
151 #if nssv_CONFIG_STD_SV_OPERATOR
+
152 
+
153 using namespace std::literals::string_view_literals;
+
154 
+
155 #endif
+
156 
+
157 #if nssv_CONFIG_USR_SV_OPERATOR
+
158 
+
159 inline namespace literals {
+
160 inline namespace string_view_literals {
161 
-
162 constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1)
-
163 {
-
164  return std::string_view{ str, len };
-
165 }
-
166 
-
167 constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2)
-
168 {
-
169  return std::u16string_view{ str, len };
-
170 }
-
171 
-
172 constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3)
-
173 {
-
174  return std::u32string_view{ str, len };
-
175 }
-
176 
-
177 constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4)
-
178 {
-
179  return std::wstring_view{ str, len };
-
180 }
-
181 
-
182 }} // namespace literals::string_view_literals
-
183 
-
184 #endif // nssv_CONFIG_USR_SV_OPERATOR
-
185 
-
186 } // namespace nonstd
-
187 
-
188 #endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
-
189 
-
190 namespace nonstd {
-
191 
-
192 using std::string_view;
-
193 using std::wstring_view;
-
194 using std::u16string_view;
-
195 using std::u32string_view;
-
196 using std::basic_string_view;
-
197 
-
198 // literal "sv" and "_sv", see above
-
199 
-
200 using std::operator==;
-
201 using std::operator!=;
-
202 using std::operator<;
-
203 using std::operator<=;
-
204 using std::operator>;
-
205 using std::operator>=;
-
206 
-
207 using std::operator<<;
-
208 
-
209 } // namespace nonstd
-
210 
-
211 #else // nssv_HAVE_STD_STRING_VIEW
-
212 
-
213 //
-
214 // Before C++17: use string_view lite:
-
215 //
-
216 
-
217 // Compiler versions:
-
218 //
-
219 // MSVC++ 6.0 _MSC_VER == 1200 nssv_COMPILER_MSVC_VERSION == 60 (Visual Studio 6.0)
-
220 // MSVC++ 7.0 _MSC_VER == 1300 nssv_COMPILER_MSVC_VERSION == 70 (Visual Studio .NET 2002)
-
221 // MSVC++ 7.1 _MSC_VER == 1310 nssv_COMPILER_MSVC_VERSION == 71 (Visual Studio .NET 2003)
-
222 // MSVC++ 8.0 _MSC_VER == 1400 nssv_COMPILER_MSVC_VERSION == 80 (Visual Studio 2005)
-
223 // MSVC++ 9.0 _MSC_VER == 1500 nssv_COMPILER_MSVC_VERSION == 90 (Visual Studio 2008)
-
224 // MSVC++ 10.0 _MSC_VER == 1600 nssv_COMPILER_MSVC_VERSION == 100 (Visual Studio 2010)
-
225 // MSVC++ 11.0 _MSC_VER == 1700 nssv_COMPILER_MSVC_VERSION == 110 (Visual Studio 2012)
-
226 // MSVC++ 12.0 _MSC_VER == 1800 nssv_COMPILER_MSVC_VERSION == 120 (Visual Studio 2013)
-
227 // MSVC++ 14.0 _MSC_VER == 1900 nssv_COMPILER_MSVC_VERSION == 140 (Visual Studio 2015)
-
228 // MSVC++ 14.1 _MSC_VER >= 1910 nssv_COMPILER_MSVC_VERSION == 141 (Visual Studio 2017)
-
229 // MSVC++ 14.2 _MSC_VER >= 1920 nssv_COMPILER_MSVC_VERSION == 142 (Visual Studio 2019)
-
230 
-
231 #if defined(_MSC_VER ) && !defined(__clang__)
-
232 # define nssv_COMPILER_MSVC_VER (_MSC_VER )
-
233 # define nssv_COMPILER_MSVC_VERSION (_MSC_VER / 10 - 10 * ( 5 + (_MSC_VER < 1900 ) ) )
-
234 #else
-
235 # define nssv_COMPILER_MSVC_VER 0
-
236 # define nssv_COMPILER_MSVC_VERSION 0
-
237 #endif
-
238 
-
239 #define nssv_COMPILER_VERSION( major, minor, patch ) ( 10 * ( 10 * (major) + (minor) ) + (patch) )
-
240 
-
241 #if defined( __apple_build_version__ )
-
242 # define nssv_COMPILER_APPLECLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
-
243 # define nssv_COMPILER_CLANG_VERSION 0
-
244 #elif defined( __clang__ )
-
245 # define nssv_COMPILER_APPLECLANG_VERSION 0
-
246 # define nssv_COMPILER_CLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
-
247 #else
-
248 # define nssv_COMPILER_APPLECLANG_VERSION 0
-
249 # define nssv_COMPILER_CLANG_VERSION 0
-
250 #endif
-
251 
-
252 #if defined(__GNUC__) && !defined(__clang__)
-
253 # define nssv_COMPILER_GNUC_VERSION nssv_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
-
254 #else
-
255 # define nssv_COMPILER_GNUC_VERSION 0
-
256 #endif
-
257 
-
258 // half-open range [lo..hi):
-
259 #define nssv_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) )
-
260 
-
261 // Presence of language and library features:
-
262 
-
263 #ifdef _HAS_CPP0X
-
264 # define nssv_HAS_CPP0X _HAS_CPP0X
-
265 #else
-
266 # define nssv_HAS_CPP0X 0
-
267 #endif
-
268 
-
269 // Unless defined otherwise below, consider VC14 as C++11 for variant-lite:
-
270 
-
271 #if nssv_COMPILER_MSVC_VER >= 1900
-
272 # undef nssv_CPP11_OR_GREATER
-
273 # define nssv_CPP11_OR_GREATER 1
-
274 #endif
-
275 
-
276 #define nssv_CPP11_90 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500)
-
277 #define nssv_CPP11_100 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600)
-
278 #define nssv_CPP11_110 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700)
-
279 #define nssv_CPP11_120 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800)
-
280 #define nssv_CPP11_140 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900)
-
281 #define nssv_CPP11_141 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910)
-
282 
-
283 #define nssv_CPP14_000 (nssv_CPP14_OR_GREATER)
-
284 #define nssv_CPP17_000 (nssv_CPP17_OR_GREATER)
-
285 
-
286 // Presence of C++11 language features:
-
287 
-
288 #define nssv_HAVE_CONSTEXPR_11 nssv_CPP11_140
-
289 #define nssv_HAVE_EXPLICIT_CONVERSION nssv_CPP11_140
-
290 #define nssv_HAVE_INLINE_NAMESPACE nssv_CPP11_140
-
291 #define nssv_HAVE_NOEXCEPT nssv_CPP11_140
-
292 #define nssv_HAVE_NULLPTR nssv_CPP11_100
-
293 #define nssv_HAVE_REF_QUALIFIER nssv_CPP11_140
-
294 #define nssv_HAVE_UNICODE_LITERALS nssv_CPP11_140
-
295 #define nssv_HAVE_USER_DEFINED_LITERALS nssv_CPP11_140
-
296 #define nssv_HAVE_WCHAR16_T nssv_CPP11_100
-
297 #define nssv_HAVE_WCHAR32_T nssv_CPP11_100
-
298 
-
299 #if ! ( ( nssv_CPP11_OR_GREATER && nssv_COMPILER_CLANG_VERSION ) || nssv_BETWEEN( nssv_COMPILER_CLANG_VERSION, 300, 400 ) )
-
300 # define nssv_HAVE_STD_DEFINED_LITERALS nssv_CPP11_140
-
301 #else
-
302 # define nssv_HAVE_STD_DEFINED_LITERALS 0
-
303 #endif
-
304 
-
305 // Presence of C++14 language features:
-
306 
-
307 #define nssv_HAVE_CONSTEXPR_14 nssv_CPP14_000
-
308 
-
309 // Presence of C++17 language features:
-
310 
-
311 #define nssv_HAVE_NODISCARD nssv_CPP17_000
-
312 
-
313 // Presence of C++ library features:
-
314 
-
315 #define nssv_HAVE_STD_HASH nssv_CPP11_120
-
316 
-
317 // Presence of compiler intrinsics:
-
318 
-
319 // Providing char-type specializations for compare() and length() that
-
320 // use compiler intrinsics can improve compile- and run-time performance.
-
321 //
-
322 // The challenge is in using the right combinations of builtin availability
-
323 // and its constexpr-ness.
+
162 
+
163 constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1)
+
164 {
+
165  return std::string_view{ str, len };
+
166 }
+
167 
+
168 constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2)
+
169 {
+
170  return std::u16string_view{ str, len };
+
171 }
+
172 
+
173 constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3)
+
174 {
+
175  return std::u32string_view{ str, len };
+
176 }
+
177 
+
178 constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4)
+
179 {
+
180  return std::wstring_view{ str, len };
+
181 }
+
182 
+
183 }} // namespace literals::string_view_literals
+
184 
+
185 #endif // nssv_CONFIG_USR_SV_OPERATOR
+
186 
+
187 } // namespace nonstd
+
188 
+
189 #endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
+
190 
+
191 namespace nonstd {
+
192 
+
193 using std::string_view;
+
194 using std::wstring_view;
+
195 using std::u16string_view;
+
196 using std::u32string_view;
+
197 using std::basic_string_view;
+
198 
+
199 // literal "sv" and "_sv", see above
+
200 
+
201 using std::operator==;
+
202 using std::operator!=;
+
203 using std::operator<;
+
204 using std::operator<=;
+
205 using std::operator>;
+
206 using std::operator>=;
+
207 
+
208 using std::operator<<;
+
209 
+
210 } // namespace nonstd
+
211 
+
212 #else // nssv_HAVE_STD_STRING_VIEW
+
213 
+
214 //
+
215 // Before C++17: use string_view lite:
+
216 //
+
217 
+
218 // Compiler versions:
+
219 //
+
220 // MSVC++ 6.0 _MSC_VER == 1200 nssv_COMPILER_MSVC_VERSION == 60 (Visual Studio 6.0)
+
221 // MSVC++ 7.0 _MSC_VER == 1300 nssv_COMPILER_MSVC_VERSION == 70 (Visual Studio .NET 2002)
+
222 // MSVC++ 7.1 _MSC_VER == 1310 nssv_COMPILER_MSVC_VERSION == 71 (Visual Studio .NET 2003)
+
223 // MSVC++ 8.0 _MSC_VER == 1400 nssv_COMPILER_MSVC_VERSION == 80 (Visual Studio 2005)
+
224 // MSVC++ 9.0 _MSC_VER == 1500 nssv_COMPILER_MSVC_VERSION == 90 (Visual Studio 2008)
+
225 // MSVC++ 10.0 _MSC_VER == 1600 nssv_COMPILER_MSVC_VERSION == 100 (Visual Studio 2010)
+
226 // MSVC++ 11.0 _MSC_VER == 1700 nssv_COMPILER_MSVC_VERSION == 110 (Visual Studio 2012)
+
227 // MSVC++ 12.0 _MSC_VER == 1800 nssv_COMPILER_MSVC_VERSION == 120 (Visual Studio 2013)
+
228 // MSVC++ 14.0 _MSC_VER == 1900 nssv_COMPILER_MSVC_VERSION == 140 (Visual Studio 2015)
+
229 // MSVC++ 14.1 _MSC_VER >= 1910 nssv_COMPILER_MSVC_VERSION == 141 (Visual Studio 2017)
+
230 // MSVC++ 14.2 _MSC_VER >= 1920 nssv_COMPILER_MSVC_VERSION == 142 (Visual Studio 2019)
+
231 
+
232 #if defined(_MSC_VER ) && !defined(__clang__)
+
233 # define nssv_COMPILER_MSVC_VER (_MSC_VER )
+
234 # define nssv_COMPILER_MSVC_VERSION (_MSC_VER / 10 - 10 * ( 5 + (_MSC_VER < 1900 ) ) )
+
235 #else
+
236 # define nssv_COMPILER_MSVC_VER 0
+
237 # define nssv_COMPILER_MSVC_VERSION 0
+
238 #endif
+
239 
+
240 #define nssv_COMPILER_VERSION( major, minor, patch ) ( 10 * ( 10 * (major) + (minor) ) + (patch) )
+
241 
+
242 #if defined( __apple_build_version__ )
+
243 # define nssv_COMPILER_APPLECLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
+
244 # define nssv_COMPILER_CLANG_VERSION 0
+
245 #elif defined( __clang__ )
+
246 # define nssv_COMPILER_APPLECLANG_VERSION 0
+
247 # define nssv_COMPILER_CLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
+
248 #else
+
249 # define nssv_COMPILER_APPLECLANG_VERSION 0
+
250 # define nssv_COMPILER_CLANG_VERSION 0
+
251 #endif
+
252 
+
253 #if defined(__GNUC__) && !defined(__clang__)
+
254 # define nssv_COMPILER_GNUC_VERSION nssv_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
+
255 #else
+
256 # define nssv_COMPILER_GNUC_VERSION 0
+
257 #endif
+
258 
+
259 // half-open range [lo..hi):
+
260 #define nssv_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) )
+
261 
+
262 // Presence of language and library features:
+
263 
+
264 #ifdef _HAS_CPP0X
+
265 # define nssv_HAS_CPP0X _HAS_CPP0X
+
266 #else
+
267 # define nssv_HAS_CPP0X 0
+
268 #endif
+
269 
+
270 // Unless defined otherwise below, consider VC14 as C++11 for variant-lite:
+
271 
+
272 #if nssv_COMPILER_MSVC_VER >= 1900
+
273 # undef nssv_CPP11_OR_GREATER
+
274 # define nssv_CPP11_OR_GREATER 1
+
275 #endif
+
276 
+
277 #define nssv_CPP11_90 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500)
+
278 #define nssv_CPP11_100 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600)
+
279 #define nssv_CPP11_110 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700)
+
280 #define nssv_CPP11_120 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800)
+
281 #define nssv_CPP11_140 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900)
+
282 #define nssv_CPP11_141 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910)
+
283 
+
284 #define nssv_CPP14_000 (nssv_CPP14_OR_GREATER)
+
285 #define nssv_CPP17_000 (nssv_CPP17_OR_GREATER)
+
286 
+
287 // Presence of C++11 language features:
+
288 
+
289 #define nssv_HAVE_CONSTEXPR_11 nssv_CPP11_140
+
290 #define nssv_HAVE_EXPLICIT_CONVERSION nssv_CPP11_140
+
291 #define nssv_HAVE_INLINE_NAMESPACE nssv_CPP11_140
+
292 #define nssv_HAVE_IS_DEFAULT nssv_CPP11_140
+
293 #define nssv_HAVE_IS_DELETE nssv_CPP11_140
+
294 #define nssv_HAVE_NOEXCEPT nssv_CPP11_140
+
295 #define nssv_HAVE_NULLPTR nssv_CPP11_100
+
296 #define nssv_HAVE_REF_QUALIFIER nssv_CPP11_140
+
297 #define nssv_HAVE_UNICODE_LITERALS nssv_CPP11_140
+
298 #define nssv_HAVE_USER_DEFINED_LITERALS nssv_CPP11_140
+
299 #define nssv_HAVE_WCHAR16_T nssv_CPP11_100
+
300 #define nssv_HAVE_WCHAR32_T nssv_CPP11_100
+
301 
+
302 #if ! ( ( nssv_CPP11_OR_GREATER && nssv_COMPILER_CLANG_VERSION ) || nssv_BETWEEN( nssv_COMPILER_CLANG_VERSION, 300, 400 ) )
+
303 # define nssv_HAVE_STD_DEFINED_LITERALS nssv_CPP11_140
+
304 #else
+
305 # define nssv_HAVE_STD_DEFINED_LITERALS 0
+
306 #endif
+
307 
+
308 // Presence of C++14 language features:
+
309 
+
310 #define nssv_HAVE_CONSTEXPR_14 nssv_CPP14_000
+
311 
+
312 // Presence of C++17 language features:
+
313 
+
314 #define nssv_HAVE_NODISCARD nssv_CPP17_000
+
315 
+
316 // Presence of C++ library features:
+
317 
+
318 #define nssv_HAVE_STD_HASH nssv_CPP11_120
+
319 
+
320 // Presence of compiler intrinsics:
+
321 
+
322 // Providing char-type specializations for compare() and length() that
+
323 // use compiler intrinsics can improve compile- and run-time performance.
324 //
-
325 // | compiler | __builtin_memcmp (constexpr) | memcmp (constexpr) |
-
326 // |----------|------------------------------|---------------------|
-
327 // | clang | 4.0 (>= 4.0 ) | any (? ) |
-
328 // | clang-a | 9.0 (>= 9.0 ) | any (? ) |
-
329 // | gcc | any (constexpr) | any (? ) |
-
330 // | msvc | >= 14.2 C++17 (>= 14.2 ) | any (? ) |
-
331 
-
332 #define nssv_HAVE_BUILTIN_VER ( (nssv_CPP17_000 && nssv_COMPILER_MSVC_VERSION >= 142) || nssv_COMPILER_GNUC_VERSION > 0 || nssv_COMPILER_CLANG_VERSION >= 400 || nssv_COMPILER_APPLECLANG_VERSION >= 900 )
-
333 #define nssv_HAVE_BUILTIN_CE ( nssv_HAVE_BUILTIN_VER )
+
325 // The challenge is in using the right combinations of builtin availability
+
326 // and its constexpr-ness.
+
327 //
+
328 // | compiler | __builtin_memcmp (constexpr) | memcmp (constexpr) |
+
329 // |----------|------------------------------|---------------------|
+
330 // | clang | 4.0 (>= 4.0 ) | any (? ) |
+
331 // | clang-a | 9.0 (>= 9.0 ) | any (? ) |
+
332 // | gcc | any (constexpr) | any (? ) |
+
333 // | msvc | >= 14.2 C++17 (>= 14.2 ) | any (? ) |
334 
-
335 #define nssv_HAVE_BUILTIN_MEMCMP ( (nssv_HAVE_CONSTEXPR_14 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_14 )
-
336 #define nssv_HAVE_BUILTIN_STRLEN ( (nssv_HAVE_CONSTEXPR_11 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_11 )
+
335 #define nssv_HAVE_BUILTIN_VER ( (nssv_CPP17_000 && nssv_COMPILER_MSVC_VERSION >= 142) || nssv_COMPILER_GNUC_VERSION > 0 || nssv_COMPILER_CLANG_VERSION >= 400 || nssv_COMPILER_APPLECLANG_VERSION >= 900 )
+
336 #define nssv_HAVE_BUILTIN_CE ( nssv_HAVE_BUILTIN_VER )
337 
-
338 #ifdef __has_builtin
-
339 # define nssv_HAVE_BUILTIN( x ) __has_builtin( x )
-
340 #else
-
341 # define nssv_HAVE_BUILTIN( x ) 0
-
342 #endif
-
343 
-
344 #if nssv_HAVE_BUILTIN(__builtin_memcmp) || nssv_HAVE_BUILTIN_VER
-
345 # define nssv_BUILTIN_MEMCMP __builtin_memcmp
-
346 #else
-
347 # define nssv_BUILTIN_MEMCMP memcmp
-
348 #endif
-
349 
-
350 #if nssv_HAVE_BUILTIN(__builtin_strlen) || nssv_HAVE_BUILTIN_VER
-
351 # define nssv_BUILTIN_STRLEN __builtin_strlen
-
352 #else
-
353 # define nssv_BUILTIN_STRLEN strlen
-
354 #endif
-
355 
-
356 // C++ feature usage:
-
357 
-
358 #if nssv_HAVE_CONSTEXPR_11
-
359 # define nssv_constexpr constexpr
-
360 #else
-
361 # define nssv_constexpr /*constexpr*/
-
362 #endif
-
363 
-
364 #if nssv_HAVE_CONSTEXPR_14
-
365 # define nssv_constexpr14 constexpr
-
366 #else
-
367 # define nssv_constexpr14 /*constexpr*/
-
368 #endif
-
369 
-
370 #if nssv_HAVE_EXPLICIT_CONVERSION
-
371 # define nssv_explicit explicit
-
372 #else
-
373 # define nssv_explicit /*explicit*/
-
374 #endif
-
375 
-
376 #if nssv_HAVE_INLINE_NAMESPACE
-
377 # define nssv_inline_ns inline
-
378 #else
-
379 # define nssv_inline_ns /*inline*/
-
380 #endif
-
381 
-
382 #if nssv_HAVE_NOEXCEPT
-
383 # define nssv_noexcept noexcept
-
384 #else
-
385 # define nssv_noexcept /*noexcept*/
-
386 #endif
-
387 
-
388 //#if nssv_HAVE_REF_QUALIFIER
-
389 //# define nssv_ref_qual &
-
390 //# define nssv_refref_qual &&
-
391 //#else
-
392 //# define nssv_ref_qual /*&*/
-
393 //# define nssv_refref_qual /*&&*/
-
394 //#endif
-
395 
-
396 #if nssv_HAVE_NULLPTR
-
397 # define nssv_nullptr nullptr
-
398 #else
-
399 # define nssv_nullptr NULL
-
400 #endif
-
401 
-
402 #if nssv_HAVE_NODISCARD
-
403 # define nssv_nodiscard [[nodiscard]]
-
404 #else
-
405 # define nssv_nodiscard /*[[nodiscard]]*/
-
406 #endif
-
407 
-
408 // Additional includes:
-
409 
-
410 #include <algorithm>
-
411 #include <cassert>
-
412 #include <iterator>
-
413 #include <limits>
-
414 #include <string> // std::char_traits<>
-
415 
-
416 #if ! nssv_CONFIG_NO_STREAM_INSERTION
-
417 # include <ostream>
-
418 #endif
-
419 
-
420 #if ! nssv_CONFIG_NO_EXCEPTIONS
-
421 # include <stdexcept>
-
422 #endif
-
423 
-
424 #if nssv_CPP11_OR_GREATER
-
425 # include <type_traits>
-
426 #endif
-
427 
-
428 // Clang, GNUC, MSVC warning suppression macros:
-
429 
-
430 #if defined(__clang__)
-
431 # pragma clang diagnostic ignored "-Wreserved-user-defined-literal"
-
432 # pragma clang diagnostic push
-
433 # pragma clang diagnostic ignored "-Wuser-defined-literals"
-
434 #elif defined(__GNUC__)
-
435 # pragma GCC diagnostic push
-
436 # pragma GCC diagnostic ignored "-Wliteral-suffix"
-
437 #endif // __clang__
-
438 
-
439 #if nssv_COMPILER_MSVC_VERSION >= 140
-
440 # define nssv_SUPPRESS_MSGSL_WARNING(expr) [[gsl::suppress(expr)]]
-
441 # define nssv_SUPPRESS_MSVC_WARNING(code, descr) __pragma(warning(suppress: code) )
-
442 # define nssv_DISABLE_MSVC_WARNINGS(codes) __pragma(warning(push)) __pragma(warning(disable: codes))
-
443 #else
-
444 # define nssv_SUPPRESS_MSGSL_WARNING(expr)
-
445 # define nssv_SUPPRESS_MSVC_WARNING(code, descr)
-
446 # define nssv_DISABLE_MSVC_WARNINGS(codes)
-
447 #endif
-
448 
-
449 #if defined(__clang__)
-
450 # define nssv_RESTORE_WARNINGS() _Pragma("clang diagnostic pop")
-
451 #elif defined(__GNUC__)
-
452 # define nssv_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop")
-
453 #elif nssv_COMPILER_MSVC_VERSION >= 140
-
454 # define nssv_RESTORE_WARNINGS() __pragma(warning(pop ))
-
455 #else
-
456 # define nssv_RESTORE_WARNINGS()
-
457 #endif
-
458 
-
459 // Suppress the following MSVC (GSL) warnings:
-
460 // - C4455, non-gsl : 'operator ""sv': literal suffix identifiers that do not
-
461 // start with an underscore are reserved
-
462 // - C26472, gsl::t.1 : don't use a static_cast for arithmetic conversions;
-
463 // use brace initialization, gsl::narrow_cast or gsl::narow
-
464 // - C26481: gsl::b.1 : don't use pointer arithmetic. Use span instead
-
465 
-
466 nssv_DISABLE_MSVC_WARNINGS( 4455 26481 26472 )
-
467 //nssv_DISABLE_CLANG_WARNINGS( "-Wuser-defined-literals" )
-
468 //nssv_DISABLE_GNUC_WARNINGS( -Wliteral-suffix )
-
469 
-
470 namespace nonstd { namespace sv_lite {
-
471 
-
472 namespace detail {
-
473 
-
474 // support constexpr comparison in C++14;
-
475 // for C++17 and later, use provided traits:
-
476 
-
477 template< typename CharT >
-
478 inline nssv_constexpr14 int compare( CharT const * s1, CharT const * s2, std::size_t count )
-
479 {
-
480  while ( count-- != 0 )
-
481  {
-
482  if ( *s1 < *s2 ) return -1;
-
483  if ( *s1 > *s2 ) return +1;
-
484  ++s1; ++s2;
-
485  }
-
486  return 0;
-
487 }
-
488 
-
489 #if nssv_HAVE_BUILTIN_MEMCMP
+
338 #define nssv_HAVE_BUILTIN_MEMCMP ( (nssv_HAVE_CONSTEXPR_14 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_14 )
+
339 #define nssv_HAVE_BUILTIN_STRLEN ( (nssv_HAVE_CONSTEXPR_11 && nssv_HAVE_BUILTIN_CE) || !nssv_HAVE_CONSTEXPR_11 )
+
340 
+
341 #ifdef __has_builtin
+
342 # define nssv_HAVE_BUILTIN( x ) __has_builtin( x )
+
343 #else
+
344 # define nssv_HAVE_BUILTIN( x ) 0
+
345 #endif
+
346 
+
347 #if nssv_HAVE_BUILTIN(__builtin_memcmp) || nssv_HAVE_BUILTIN_VER
+
348 # define nssv_BUILTIN_MEMCMP __builtin_memcmp
+
349 #else
+
350 # define nssv_BUILTIN_MEMCMP memcmp
+
351 #endif
+
352 
+
353 #if nssv_HAVE_BUILTIN(__builtin_strlen) || nssv_HAVE_BUILTIN_VER
+
354 # define nssv_BUILTIN_STRLEN __builtin_strlen
+
355 #else
+
356 # define nssv_BUILTIN_STRLEN strlen
+
357 #endif
+
358 
+
359 // C++ feature usage:
+
360 
+
361 #if nssv_HAVE_CONSTEXPR_11
+
362 # define nssv_constexpr constexpr
+
363 #else
+
364 # define nssv_constexpr /*constexpr*/
+
365 #endif
+
366 
+
367 #if nssv_HAVE_CONSTEXPR_14
+
368 # define nssv_constexpr14 constexpr
+
369 #else
+
370 # define nssv_constexpr14 /*constexpr*/
+
371 #endif
+
372 
+
373 #if nssv_HAVE_EXPLICIT_CONVERSION
+
374 # define nssv_explicit explicit
+
375 #else
+
376 # define nssv_explicit /*explicit*/
+
377 #endif
+
378 
+
379 #if nssv_HAVE_INLINE_NAMESPACE
+
380 # define nssv_inline_ns inline
+
381 #else
+
382 # define nssv_inline_ns /*inline*/
+
383 #endif
+
384 
+
385 #if nssv_HAVE_NOEXCEPT
+
386 # define nssv_noexcept noexcept
+
387 #else
+
388 # define nssv_noexcept /*noexcept*/
+
389 #endif
+
390 
+
391 //#if nssv_HAVE_REF_QUALIFIER
+
392 //# define nssv_ref_qual &
+
393 //# define nssv_refref_qual &&
+
394 //#else
+
395 //# define nssv_ref_qual /*&*/
+
396 //# define nssv_refref_qual /*&&*/
+
397 //#endif
+
398 
+
399 #if nssv_HAVE_NULLPTR
+
400 # define nssv_nullptr nullptr
+
401 #else
+
402 # define nssv_nullptr NULL
+
403 #endif
+
404 
+
405 #if nssv_HAVE_NODISCARD
+
406 # define nssv_nodiscard [[nodiscard]]
+
407 #else
+
408 # define nssv_nodiscard /*[[nodiscard]]*/
+
409 #endif
+
410 
+
411 // Additional includes:
+
412 
+
413 #include <algorithm>
+
414 #include <cassert>
+
415 #include <iterator>
+
416 #include <limits>
+
417 #include <string> // std::char_traits<>
+
418 
+
419 #if ! nssv_CONFIG_NO_STREAM_INSERTION
+
420 # include <ostream>
+
421 #endif
+
422 
+
423 #if ! nssv_CONFIG_NO_EXCEPTIONS
+
424 # include <stdexcept>
+
425 #endif
+
426 
+
427 #if nssv_CPP11_OR_GREATER
+
428 # include <type_traits>
+
429 #endif
+
430 
+
431 // Clang, GNUC, MSVC warning suppression macros:
+
432 
+
433 #if defined(__clang__)
+
434 # pragma clang diagnostic ignored "-Wreserved-user-defined-literal"
+
435 # pragma clang diagnostic push
+
436 # pragma clang diagnostic ignored "-Wuser-defined-literals"
+
437 #elif defined(__GNUC__)
+
438 # pragma GCC diagnostic push
+
439 # pragma GCC diagnostic ignored "-Wliteral-suffix"
+
440 #endif // __clang__
+
441 
+
442 #if nssv_COMPILER_MSVC_VERSION >= 140
+
443 # define nssv_SUPPRESS_MSGSL_WARNING(expr) [[gsl::suppress(expr)]]
+
444 # define nssv_SUPPRESS_MSVC_WARNING(code, descr) __pragma(warning(suppress: code) )
+
445 # define nssv_DISABLE_MSVC_WARNINGS(codes) __pragma(warning(push)) __pragma(warning(disable: codes))
+
446 #else
+
447 # define nssv_SUPPRESS_MSGSL_WARNING(expr)
+
448 # define nssv_SUPPRESS_MSVC_WARNING(code, descr)
+
449 # define nssv_DISABLE_MSVC_WARNINGS(codes)
+
450 #endif
+
451 
+
452 #if defined(__clang__)
+
453 # define nssv_RESTORE_WARNINGS() _Pragma("clang diagnostic pop")
+
454 #elif defined(__GNUC__)
+
455 # define nssv_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop")
+
456 #elif nssv_COMPILER_MSVC_VERSION >= 140
+
457 # define nssv_RESTORE_WARNINGS() __pragma(warning(pop ))
+
458 #else
+
459 # define nssv_RESTORE_WARNINGS()
+
460 #endif
+
461 
+
462 // Suppress the following MSVC (GSL) warnings:
+
463 // - C4455, non-gsl : 'operator ""sv': literal suffix identifiers that do not
+
464 // start with an underscore are reserved
+
465 // - C26472, gsl::t.1 : don't use a static_cast for arithmetic conversions;
+
466 // use brace initialization, gsl::narrow_cast or gsl::narow
+
467 // - C26481: gsl::b.1 : don't use pointer arithmetic. Use span instead
+
468 
+
469 nssv_DISABLE_MSVC_WARNINGS( 4455 26481 26472 )
+
470 //nssv_DISABLE_CLANG_WARNINGS( "-Wuser-defined-literals" )
+
471 //nssv_DISABLE_GNUC_WARNINGS( -Wliteral-suffix )
+
472 
+
473 namespace nonstd { namespace sv_lite {
+
474 
+
475 //
+
476 // basic_string_view declaration:
+
477 //
+
478 
+
479 template
+
480 <
+
481  class CharT,
+
482  class Traits = std::char_traits<CharT>
+
483 >
+
484 class basic_string_view;
+
485 
+
486 namespace detail {
+
487 
+
488 // support constexpr comparison in C++14;
+
489 // for C++17 and later, use provided traits:
490 
-
491 // specialization of compare() for char, see also generic compare() above:
-
492 
-
493 inline nssv_constexpr14 int compare( char const * s1, char const * s2, std::size_t count )
-
494 {
-
495  return nssv_BUILTIN_MEMCMP( s1, s2, count );
-
496 }
-
497 
-
498 #endif
-
499 
-
500 #if nssv_HAVE_BUILTIN_STRLEN
-
501 
-
502 // specialization of length() for char, see also generic length() further below:
-
503 
-
504 inline nssv_constexpr std::size_t length( char const * s )
-
505 {
-
506  return nssv_BUILTIN_STRLEN( s );
-
507 }
-
508 
-
509 #endif
-
510 
-
511 #if defined(__OPTIMIZE__)
-
512 
-
513 // gcc, clang provide __OPTIMIZE__
-
514 // Expect tail call optimization to make length() non-recursive:
+
491 template< typename CharT >
+
492 inline nssv_constexpr14 int compare( CharT const * s1, CharT const * s2, std::size_t count )
+
493 {
+
494  while ( count-- != 0 )
+
495  {
+
496  if ( *s1 < *s2 ) return -1;
+
497  if ( *s1 > *s2 ) return +1;
+
498  ++s1; ++s2;
+
499  }
+
500  return 0;
+
501 }
+
502 
+
503 #if nssv_HAVE_BUILTIN_MEMCMP
+
504 
+
505 // specialization of compare() for char, see also generic compare() above:
+
506 
+
507 inline nssv_constexpr14 int compare( char const * s1, char const * s2, std::size_t count )
+
508 {
+
509  return nssv_BUILTIN_MEMCMP( s1, s2, count );
+
510 }
+
511 
+
512 #endif
+
513 
+
514 #if nssv_HAVE_BUILTIN_STRLEN
515 
-
516 template< typename CharT >
-
517 inline nssv_constexpr std::size_t length( CharT * s, std::size_t result = 0 )
-
518 {
-
519  return *s == '\0' ? result : length( s + 1, result + 1 );
-
520 }
-
521 
-
522 #else // OPTIMIZE
-
523 
-
524 // non-recursive:
-
525 
-
526 template< typename CharT >
-
527 inline nssv_constexpr14 std::size_t length( CharT * s )
-
528 {
-
529  std::size_t result = 0;
-
530  while ( *s++ != '\0' )
-
531  {
-
532  ++result;
-
533  }
-
534  return result;
-
535 }
-
536 
-
537 #endif // OPTIMIZE
-
538 
-
539 } // namespace detail
-
540 
-
541 template
-
542 <
-
543  class CharT,
-
544  class Traits = std::char_traits<CharT>
-
545 >
-
546 class basic_string_view;
-
547 
-
548 //
-
549 // basic_string_view:
-
550 //
-
551 
-
552 template
-
553 <
-
554  class CharT,
-
555  class Traits /* = std::char_traits<CharT> */
-
556 >
-
557 class basic_string_view
-
558 {
-
559 public:
-
560  // Member types:
-
561 
-
562  typedef Traits traits_type;
-
563  typedef CharT value_type;
-
564 
-
565  typedef CharT * pointer;
-
566  typedef CharT const * const_pointer;
-
567  typedef CharT & reference;
-
568  typedef CharT const & const_reference;
+
516 // specialization of length() for char, see also generic length() further below:
+
517 
+
518 inline nssv_constexpr std::size_t length( char const * s )
+
519 {
+
520  return nssv_BUILTIN_STRLEN( s );
+
521 }
+
522 
+
523 #endif
+
524 
+
525 #if defined(__OPTIMIZE__)
+
526 
+
527 // gcc, clang provide __OPTIMIZE__
+
528 // Expect tail call optimization to make length() non-recursive:
+
529 
+
530 template< typename CharT >
+
531 inline nssv_constexpr std::size_t length( CharT * s, std::size_t result = 0 )
+
532 {
+
533  return *s == '\0' ? result : length( s + 1, result + 1 );
+
534 }
+
535 
+
536 #else // OPTIMIZE
+
537 
+
538 // non-recursive:
+
539 
+
540 template< typename CharT >
+
541 inline nssv_constexpr14 std::size_t length( CharT * s )
+
542 {
+
543  std::size_t result = 0;
+
544  while ( *s++ != '\0' )
+
545  {
+
546  ++result;
+
547  }
+
548  return result;
+
549 }
+
550 
+
551 #endif // OPTIMIZE
+
552 
+
553 #if nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER
+
554 #if defined(__OPTIMIZE__)
+
555 
+
556 // gcc, clang provide __OPTIMIZE__
+
557 // Expect tail call optimization to make search() non-recursive:
+
558 
+
559 template< class CharT, class Traits = std::char_traits<CharT> >
+
560 constexpr const CharT* search( basic_string_view<CharT, Traits> haystack, basic_string_view<CharT, Traits> needle )
+
561 {
+
562  return haystack.starts_with( needle ) ? haystack.begin() :
+
563  haystack.empty() ? haystack.end() : search( haystack.substr(1), needle );
+
564 }
+
565 
+
566 #else // OPTIMIZE
+
567 
+
568 // non-recursive:
569 
-
570  typedef const_pointer iterator;
-
571  typedef const_pointer const_iterator;
-
572  typedef std::reverse_iterator< const_iterator > reverse_iterator;
-
573  typedef std::reverse_iterator< const_iterator > const_reverse_iterator;
-
574 
-
575  typedef std::size_t size_type;
-
576  typedef std::ptrdiff_t difference_type;
-
577 
-
578  // 24.4.2.1 Construction and assignment:
-
579 
-
580  nssv_constexpr basic_string_view() nssv_noexcept
-
581  : data_( nssv_nullptr )
-
582  , size_( 0 )
-
583  {}
+
570 template< class CharT, class Traits = std::char_traits<CharT> >
+
571 constexpr const CharT* search( basic_string_view<CharT, Traits> haystack, basic_string_view<CharT, Traits> needle )
+
572 {
+
573  return std::search( haystack.begin(), haystack.end(), needle.begin(), needle.end() );
+
574 }
+
575 
+
576 #endif // OPTIMIZE
+
577 #endif // nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER
+
578 
+
579 } // namespace detail
+
580 
+
581 //
+
582 // basic_string_view:
+
583 //
584 
-
585 #if nssv_CPP11_OR_GREATER
-
586  nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept = default;
-
587 #else
-
588  nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept
-
589  : data_( other.data_)
-
590  , size_( other.size_)
-
591  {}
-
592 #endif
-
593 
-
594  nssv_constexpr basic_string_view( CharT const * s, size_type count ) nssv_noexcept // non-standard noexcept
-
595  : data_( s )
-
596  , size_( count )
-
597  {}
-
598 
-
599  nssv_constexpr basic_string_view( CharT const * s) nssv_noexcept // non-standard noexcept
-
600  : data_( s )
-
601 #if nssv_CPP17_OR_GREATER
-
602  , size_( Traits::length(s) )
-
603 #elif nssv_CPP11_OR_GREATER
-
604  , size_( detail::length(s) )
-
605 #else
-
606  , size_( Traits::length(s) )
-
607 #endif
-
608  {}
-
609 
-
610  // Assignment:
-
611 
-
612 #if nssv_CPP11_OR_GREATER
-
613  nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept = default;
-
614 #else
-
615  nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept
-
616  {
-
617  data_ = other.data_;
-
618  size_ = other.size_;
-
619  return *this;
-
620  }
-
621 #endif
-
622 
-
623  // 24.4.2.2 Iterator support:
-
624 
-
625  nssv_constexpr const_iterator begin() const nssv_noexcept { return data_; }
-
626  nssv_constexpr const_iterator end() const nssv_noexcept { return data_ + size_; }
-
627 
-
628  nssv_constexpr const_iterator cbegin() const nssv_noexcept { return begin(); }
-
629  nssv_constexpr const_iterator cend() const nssv_noexcept { return end(); }
-
630 
-
631  nssv_constexpr const_reverse_iterator rbegin() const nssv_noexcept { return const_reverse_iterator( end() ); }
-
632  nssv_constexpr const_reverse_iterator rend() const nssv_noexcept { return const_reverse_iterator( begin() ); }
-
633 
-
634  nssv_constexpr const_reverse_iterator crbegin() const nssv_noexcept { return rbegin(); }
-
635  nssv_constexpr const_reverse_iterator crend() const nssv_noexcept { return rend(); }
-
636 
-
637  // 24.4.2.3 Capacity:
-
638 
-
639  nssv_constexpr size_type size() const nssv_noexcept { return size_; }
-
640  nssv_constexpr size_type length() const nssv_noexcept { return size_; }
-
641  nssv_constexpr size_type max_size() const nssv_noexcept { return (std::numeric_limits< size_type >::max)(); }
+
585 template
+
586 <
+
587  class CharT,
+
588  class Traits /* = std::char_traits<CharT> */
+
589 >
+
590 class basic_string_view
+
591 {
+
592 public:
+
593  // Member types:
+
594 
+
595  typedef Traits traits_type;
+
596  typedef CharT value_type;
+
597 
+
598  typedef CharT * pointer;
+
599  typedef CharT const * const_pointer;
+
600  typedef CharT & reference;
+
601  typedef CharT const & const_reference;
+
602 
+
603  typedef const_pointer iterator;
+
604  typedef const_pointer const_iterator;
+
605  typedef std::reverse_iterator< const_iterator > reverse_iterator;
+
606  typedef std::reverse_iterator< const_iterator > const_reverse_iterator;
+
607 
+
608  typedef std::size_t size_type;
+
609  typedef std::ptrdiff_t difference_type;
+
610 
+
611  // 24.4.2.1 Construction and assignment:
+
612 
+
613  nssv_constexpr basic_string_view() nssv_noexcept
+
614  : data_( nssv_nullptr )
+
615  , size_( 0 )
+
616  {}
+
617 
+
618 #if nssv_CPP11_OR_GREATER
+
619  nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept = default;
+
620 #else
+
621  nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept
+
622  : data_( other.data_)
+
623  , size_( other.size_)
+
624  {}
+
625 #endif
+
626 
+
627  nssv_constexpr basic_string_view( CharT const * s, size_type count ) nssv_noexcept // non-standard noexcept
+
628  : data_( s )
+
629  , size_( count )
+
630  {}
+
631 
+
632  nssv_constexpr basic_string_view( CharT const * s) nssv_noexcept // non-standard noexcept
+
633  : data_( s )
+
634 #if nssv_CPP17_OR_GREATER
+
635  , size_( Traits::length(s) )
+
636 #elif nssv_CPP11_OR_GREATER
+
637  , size_( detail::length(s) )
+
638 #else
+
639  , size_( Traits::length(s) )
+
640 #endif
+
641  {}
642 
-
643  // since C++20
-
644  nssv_nodiscard nssv_constexpr bool empty() const nssv_noexcept
-
645  {
-
646  return 0 == size_;
-
647  }
-
648 
-
649  // 24.4.2.4 Element access:
+
643 #if nssv_HAVE_NULLPTR
+
644 # if nssv_HAVE_IS_DELETE
+
645  nssv_constexpr basic_string_view( std::nullptr_t ) nssv_noexcept = delete;
+
646 # else
+
647  private: nssv_constexpr basic_string_view( std::nullptr_t ) nssv_noexcept; public:
+
648 # endif
+
649 #endif
650 
-
651  nssv_constexpr const_reference operator[]( size_type pos ) const
-
652  {
-
653  return data_at( pos );
-
654  }
-
655 
-
656  nssv_constexpr14 const_reference at( size_type pos ) const
-
657  {
-
658 #if nssv_CONFIG_NO_EXCEPTIONS
-
659  assert( pos < size() );
-
660 #else
-
661  if ( pos >= size() )
-
662  {
-
663  throw std::out_of_range("nonstd::string_view::at()");
-
664  }
-
665 #endif
-
666  return data_at( pos );
-
667  }
+
651  // Assignment:
+
652 
+
653 #if nssv_CPP11_OR_GREATER
+
654  nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept = default;
+
655 #else
+
656  nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept
+
657  {
+
658  data_ = other.data_;
+
659  size_ = other.size_;
+
660  return *this;
+
661  }
+
662 #endif
+
663 
+
664  // 24.4.2.2 Iterator support:
+
665 
+
666  nssv_constexpr const_iterator begin() const nssv_noexcept { return data_; }
+
667  nssv_constexpr const_iterator end() const nssv_noexcept { return data_ + size_; }
668 
-
669  nssv_constexpr const_reference front() const { return data_at( 0 ); }
-
670  nssv_constexpr const_reference back() const { return data_at( size() - 1 ); }
+
669  nssv_constexpr const_iterator cbegin() const nssv_noexcept { return begin(); }
+
670  nssv_constexpr const_iterator cend() const nssv_noexcept { return end(); }
671 
-
672  nssv_constexpr const_pointer data() const nssv_noexcept { return data_; }
-
673 
-
674  // 24.4.2.5 Modifiers:
-
675 
-
676  nssv_constexpr14 void remove_prefix( size_type n )
-
677  {
-
678  assert( n <= size() );
-
679  data_ += n;
-
680  size_ -= n;
-
681  }
-
682 
-
683  nssv_constexpr14 void remove_suffix( size_type n )
-
684  {
-
685  assert( n <= size() );
-
686  size_ -= n;
-
687  }
-
688 
-
689  nssv_constexpr14 void swap( basic_string_view & other ) nssv_noexcept
-
690  {
-
691  const basic_string_view tmp(other);
-
692  other = *this;
-
693  *this = tmp;
-
694  }
-
695 
-
696  // 24.4.2.6 String operations:
-
697 
-
698  size_type copy( CharT * dest, size_type n, size_type pos = 0 ) const
-
699  {
-
700 #if nssv_CONFIG_NO_EXCEPTIONS
-
701  assert( pos <= size() );
-
702 #else
-
703  if ( pos > size() )
-
704  {
-
705  throw std::out_of_range("nonstd::string_view::copy()");
-
706  }
-
707 #endif
-
708  const size_type rlen = (std::min)( n, size() - pos );
+
672  nssv_constexpr const_reverse_iterator rbegin() const nssv_noexcept { return const_reverse_iterator( end() ); }
+
673  nssv_constexpr const_reverse_iterator rend() const nssv_noexcept { return const_reverse_iterator( begin() ); }
+
674 
+
675  nssv_constexpr const_reverse_iterator crbegin() const nssv_noexcept { return rbegin(); }
+
676  nssv_constexpr const_reverse_iterator crend() const nssv_noexcept { return rend(); }
+
677 
+
678  // 24.4.2.3 Capacity:
+
679 
+
680  nssv_constexpr size_type size() const nssv_noexcept { return size_; }
+
681  nssv_constexpr size_type length() const nssv_noexcept { return size_; }
+
682  nssv_constexpr size_type max_size() const nssv_noexcept { return (std::numeric_limits< size_type >::max)(); }
+
683 
+
684  // since C++20
+
685  nssv_nodiscard nssv_constexpr bool empty() const nssv_noexcept
+
686  {
+
687  return 0 == size_;
+
688  }
+
689 
+
690  // 24.4.2.4 Element access:
+
691 
+
692  nssv_constexpr const_reference operator[]( size_type pos ) const
+
693  {
+
694  return data_at( pos );
+
695  }
+
696 
+
697  nssv_constexpr14 const_reference at( size_type pos ) const
+
698  {
+
699 #if nssv_CONFIG_NO_EXCEPTIONS
+
700  assert( pos < size() );
+
701 #else
+
702  if ( pos >= size() )
+
703  {
+
704  throw std::out_of_range("nonstd::string_view::at()");
+
705  }
+
706 #endif
+
707  return data_at( pos );
+
708  }
709 
-
710  (void) Traits::copy( dest, data() + pos, rlen );
-
711 
-
712  return rlen;
-
713  }
+
710  nssv_constexpr const_reference front() const { return data_at( 0 ); }
+
711  nssv_constexpr const_reference back() const { return data_at( size() - 1 ); }
+
712 
+
713  nssv_constexpr const_pointer data() const nssv_noexcept { return data_; }
714 
-
715  nssv_constexpr14 basic_string_view substr( size_type pos = 0, size_type n = npos ) const
-
716  {
-
717 #if nssv_CONFIG_NO_EXCEPTIONS
-
718  assert( pos <= size() );
-
719 #else
-
720  if ( pos > size() )
-
721  {
-
722  throw std::out_of_range("nonstd::string_view::substr()");
-
723  }
-
724 #endif
-
725  return basic_string_view( data() + pos, (std::min)( n, size() - pos ) );
-
726  }
-
727 
-
728  // compare(), 6x:
+
715  // 24.4.2.5 Modifiers:
+
716 
+
717  nssv_constexpr14 void remove_prefix( size_type n )
+
718  {
+
719  assert( n <= size() );
+
720  data_ += n;
+
721  size_ -= n;
+
722  }
+
723 
+
724  nssv_constexpr14 void remove_suffix( size_type n )
+
725  {
+
726  assert( n <= size() );
+
727  size_ -= n;
+
728  }
729 
-
730  nssv_constexpr14 int compare( basic_string_view other ) const nssv_noexcept // (1)
+
730  nssv_constexpr14 void swap( basic_string_view & other ) nssv_noexcept
731  {
-
732 #if nssv_CPP17_OR_GREATER
-
733  if ( const int result = Traits::compare( data(), other.data(), (std::min)( size(), other.size() ) ) )
-
734 #else
-
735  if ( const int result = detail::compare( data(), other.data(), (std::min)( size(), other.size() ) ) )
-
736 #endif
-
737  {
-
738  return result;
-
739  }
-
740 
-
741  return size() == other.size() ? 0 : size() < other.size() ? -1 : 1;
-
742  }
-
743 
-
744  nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other ) const // (2)
-
745  {
-
746  return substr( pos1, n1 ).compare( other );
-
747  }
-
748 
-
749  nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other, size_type pos2, size_type n2 ) const // (3)
-
750  {
-
751  return substr( pos1, n1 ).compare( other.substr( pos2, n2 ) );
-
752  }
-
753 
-
754  nssv_constexpr int compare( CharT const * s ) const // (4)
-
755  {
-
756  return compare( basic_string_view( s ) );
-
757  }
-
758 
-
759  nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s ) const // (5)
-
760  {
-
761  return substr( pos1, n1 ).compare( basic_string_view( s ) );
-
762  }
-
763 
-
764  nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s, size_type n2 ) const // (6)
-
765  {
-
766  return substr( pos1, n1 ).compare( basic_string_view( s, n2 ) );
+
732  const basic_string_view tmp(other);
+
733  other = *this;
+
734  *this = tmp;
+
735  }
+
736 
+
737  // 24.4.2.6 String operations:
+
738 
+
739  size_type copy( CharT * dest, size_type n, size_type pos = 0 ) const
+
740  {
+
741 #if nssv_CONFIG_NO_EXCEPTIONS
+
742  assert( pos <= size() );
+
743 #else
+
744  if ( pos > size() )
+
745  {
+
746  throw std::out_of_range("nonstd::string_view::copy()");
+
747  }
+
748 #endif
+
749  const size_type rlen = (std::min)( n, size() - pos );
+
750 
+
751  (void) Traits::copy( dest, data() + pos, rlen );
+
752 
+
753  return rlen;
+
754  }
+
755 
+
756  nssv_constexpr14 basic_string_view substr( size_type pos = 0, size_type n = npos ) const
+
757  {
+
758 #if nssv_CONFIG_NO_EXCEPTIONS
+
759  assert( pos <= size() );
+
760 #else
+
761  if ( pos > size() )
+
762  {
+
763  throw std::out_of_range("nonstd::string_view::substr()");
+
764  }
+
765 #endif
+
766  return basic_string_view( data() + pos, (std::min)( n, size() - pos ) );
767  }
768 
-
769  // 24.4.2.7 Searching:
+
769  // compare(), 6x:
770 
-
771  // starts_with(), 3x, since C++20:
-
772 
-
773  nssv_constexpr bool starts_with( basic_string_view v ) const nssv_noexcept // (1)
-
774  {
-
775  return size() >= v.size() && compare( 0, v.size(), v ) == 0;
-
776  }
-
777 
-
778  nssv_constexpr bool starts_with( CharT c ) const nssv_noexcept // (2)
-
779  {
-
780  return starts_with( basic_string_view( &c, 1 ) );
-
781  }
-
782 
-
783  nssv_constexpr bool starts_with( CharT const * s ) const // (3)
-
784  {
-
785  return starts_with( basic_string_view( s ) );
-
786  }
-
787 
-
788  // ends_with(), 3x, since C++20:
+
771  nssv_constexpr14 int compare( basic_string_view other ) const nssv_noexcept // (1)
+
772  {
+
773 #if nssv_CPP17_OR_GREATER
+
774  if ( const int result = Traits::compare( data(), other.data(), (std::min)( size(), other.size() ) ) )
+
775 #else
+
776  if ( const int result = detail::compare( data(), other.data(), (std::min)( size(), other.size() ) ) )
+
777 #endif
+
778  {
+
779  return result;
+
780  }
+
781 
+
782  return size() == other.size() ? 0 : size() < other.size() ? -1 : 1;
+
783  }
+
784 
+
785  nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other ) const // (2)
+
786  {
+
787  return substr( pos1, n1 ).compare( other );
+
788  }
789 
-
790  nssv_constexpr bool ends_with( basic_string_view v ) const nssv_noexcept // (1)
+
790  nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other, size_type pos2, size_type n2 ) const // (3)
791  {
-
792  return size() >= v.size() && compare( size() - v.size(), npos, v ) == 0;
+
792  return substr( pos1, n1 ).compare( other.substr( pos2, n2 ) );
793  }
794 
-
795  nssv_constexpr bool ends_with( CharT c ) const nssv_noexcept // (2)
+
795  nssv_constexpr int compare( CharT const * s ) const // (4)
796  {
-
797  return ends_with( basic_string_view( &c, 1 ) );
+
797  return compare( basic_string_view( s ) );
798  }
799 
-
800  nssv_constexpr bool ends_with( CharT const * s ) const // (3)
+
800  nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s ) const // (5)
801  {
-
802  return ends_with( basic_string_view( s ) );
+
802  return substr( pos1, n1 ).compare( basic_string_view( s ) );
803  }
804 
-
805  // find(), 4x:
-
806 
-
807  nssv_constexpr14 size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
-
808  {
-
809  return assert( v.size() == 0 || v.data() != nssv_nullptr )
-
810  , pos >= size()
-
811  ? npos
-
812  : to_pos( std::search( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) );
-
813  }
-
814 
-
815  nssv_constexpr14 size_type find( CharT c, size_type pos = 0 ) const nssv_noexcept // (2)
-
816  {
-
817  return find( basic_string_view( &c, 1 ), pos );
-
818  }
-
819 
-
820  nssv_constexpr14 size_type find( CharT const * s, size_type pos, size_type n ) const // (3)
-
821  {
-
822  return find( basic_string_view( s, n ), pos );
-
823  }
-
824 
-
825  nssv_constexpr14 size_type find( CharT const * s, size_type pos = 0 ) const // (4)
-
826  {
-
827  return find( basic_string_view( s ), pos );
-
828  }
-
829 
-
830  // rfind(), 4x:
-
831 
-
832  nssv_constexpr14 size_type rfind( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1)
-
833  {
-
834  if ( size() < v.size() )
-
835  {
-
836  return npos;
-
837  }
-
838 
-
839  if ( v.empty() )
-
840  {
-
841  return (std::min)( size(), pos );
-
842  }
-
843 
-
844  const_iterator last = cbegin() + (std::min)( size() - v.size(), pos ) + v.size();
-
845  const_iterator result = std::find_end( cbegin(), last, v.cbegin(), v.cend(), Traits::eq );
-
846 
-
847  return result != last ? size_type( result - cbegin() ) : npos;
-
848  }
-
849 
-
850  nssv_constexpr14 size_type rfind( CharT c, size_type pos = npos ) const nssv_noexcept // (2)
-
851  {
-
852  return rfind( basic_string_view( &c, 1 ), pos );
-
853  }
-
854 
-
855  nssv_constexpr14 size_type rfind( CharT const * s, size_type pos, size_type n ) const // (3)
-
856  {
-
857  return rfind( basic_string_view( s, n ), pos );
-
858  }
-
859 
-
860  nssv_constexpr14 size_type rfind( CharT const * s, size_type pos = npos ) const // (4)
-
861  {
-
862  return rfind( basic_string_view( s ), pos );
-
863  }
-
864 
-
865  // find_first_of(), 4x:
-
866 
-
867  nssv_constexpr size_type find_first_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
-
868  {
-
869  return pos >= size()
-
870  ? npos
-
871  : to_pos( std::find_first_of( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) );
-
872  }
-
873 
-
874  nssv_constexpr size_type find_first_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2)
-
875  {
-
876  return find_first_of( basic_string_view( &c, 1 ), pos );
-
877  }
-
878 
-
879  nssv_constexpr size_type find_first_of( CharT const * s, size_type pos, size_type n ) const // (3)
-
880  {
-
881  return find_first_of( basic_string_view( s, n ), pos );
-
882  }
-
883 
-
884  nssv_constexpr size_type find_first_of( CharT const * s, size_type pos = 0 ) const // (4)
-
885  {
-
886  return find_first_of( basic_string_view( s ), pos );
-
887  }
-
888 
-
889  // find_last_of(), 4x:
-
890 
-
891  nssv_constexpr size_type find_last_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1)
-
892  {
-
893  return empty()
-
894  ? npos
-
895  : pos >= size()
-
896  ? find_last_of( v, size() - 1 )
-
897  : to_pos( std::find_first_of( const_reverse_iterator( cbegin() + pos + 1 ), crend(), v.cbegin(), v.cend(), Traits::eq ) );
-
898  }
-
899 
-
900  nssv_constexpr size_type find_last_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2)
-
901  {
-
902  return find_last_of( basic_string_view( &c, 1 ), pos );
-
903  }
-
904 
-
905  nssv_constexpr size_type find_last_of( CharT const * s, size_type pos, size_type count ) const // (3)
-
906  {
-
907  return find_last_of( basic_string_view( s, count ), pos );
-
908  }
-
909 
-
910  nssv_constexpr size_type find_last_of( CharT const * s, size_type pos = npos ) const // (4)
-
911  {
-
912  return find_last_of( basic_string_view( s ), pos );
-
913  }
-
914 
-
915  // find_first_not_of(), 4x:
-
916 
-
917  nssv_constexpr size_type find_first_not_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
-
918  {
-
919  return pos >= size()
-
920  ? npos
-
921  : to_pos( std::find_if( cbegin() + pos, cend(), not_in_view( v ) ) );
-
922  }
-
923 
-
924  nssv_constexpr size_type find_first_not_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2)
-
925  {
-
926  return find_first_not_of( basic_string_view( &c, 1 ), pos );
-
927  }
-
928 
-
929  nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos, size_type count ) const // (3)
-
930  {
-
931  return find_first_not_of( basic_string_view( s, count ), pos );
-
932  }
-
933 
-
934  nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos = 0 ) const // (4)
-
935  {
-
936  return find_first_not_of( basic_string_view( s ), pos );
-
937  }
-
938 
-
939  // find_last_not_of(), 4x:
-
940 
-
941  nssv_constexpr size_type find_last_not_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1)
-
942  {
-
943  return empty()
-
944  ? npos
-
945  : pos >= size()
-
946  ? find_last_not_of( v, size() - 1 )
-
947  : to_pos( std::find_if( const_reverse_iterator( cbegin() + pos + 1 ), crend(), not_in_view( v ) ) );
-
948  }
-
949 
-
950  nssv_constexpr size_type find_last_not_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2)
-
951  {
-
952  return find_last_not_of( basic_string_view( &c, 1 ), pos );
-
953  }
-
954 
-
955  nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos, size_type count ) const // (3)
-
956  {
-
957  return find_last_not_of( basic_string_view( s, count ), pos );
-
958  }
-
959 
-
960  nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos = npos ) const // (4)
-
961  {
-
962  return find_last_not_of( basic_string_view( s ), pos );
-
963  }
-
964 
-
965  // Constants:
-
966 
-
967 #if nssv_CPP17_OR_GREATER
-
968  static nssv_constexpr size_type npos = size_type(-1);
-
969 #elif nssv_CPP11_OR_GREATER
-
970  enum : size_type { npos = size_type(-1) };
-
971 #else
-
972  enum { npos = size_type(-1) };
-
973 #endif
+
805  nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s, size_type n2 ) const // (6)
+
806  {
+
807  return substr( pos1, n1 ).compare( basic_string_view( s, n2 ) );
+
808  }
+
809 
+
810  // 24.4.2.7 Searching:
+
811 
+
812  // starts_with(), 3x, since C++20:
+
813 
+
814  nssv_constexpr bool starts_with( basic_string_view v ) const nssv_noexcept // (1)
+
815  {
+
816  return size() >= v.size() && compare( 0, v.size(), v ) == 0;
+
817  }
+
818 
+
819  nssv_constexpr bool starts_with( CharT c ) const nssv_noexcept // (2)
+
820  {
+
821  return starts_with( basic_string_view( &c, 1 ) );
+
822  }
+
823 
+
824  nssv_constexpr bool starts_with( CharT const * s ) const // (3)
+
825  {
+
826  return starts_with( basic_string_view( s ) );
+
827  }
+
828 
+
829  // ends_with(), 3x, since C++20:
+
830 
+
831  nssv_constexpr bool ends_with( basic_string_view v ) const nssv_noexcept // (1)
+
832  {
+
833  return size() >= v.size() && compare( size() - v.size(), npos, v ) == 0;
+
834  }
+
835 
+
836  nssv_constexpr bool ends_with( CharT c ) const nssv_noexcept // (2)
+
837  {
+
838  return ends_with( basic_string_view( &c, 1 ) );
+
839  }
+
840 
+
841  nssv_constexpr bool ends_with( CharT const * s ) const // (3)
+
842  {
+
843  return ends_with( basic_string_view( s ) );
+
844  }
+
845 
+
846  // find(), 4x:
+
847 
+
848  nssv_constexpr size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
+
849  {
+
850  return assert( v.size() == 0 || v.data() != nssv_nullptr )
+
851  , pos >= size()
+
852  ? npos : to_pos(
+
853 #if nssv_CPP11_OR_GREATER && ! nssv_CPP17_OR_GREATER
+
854  detail::search( substr(pos), v )
+
855 #else
+
856  std::search( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq )
+
857 #endif
+
858  );
+
859  }
+
860 
+
861  nssv_constexpr size_type find( CharT c, size_type pos = 0 ) const nssv_noexcept // (2)
+
862  {
+
863  return find( basic_string_view( &c, 1 ), pos );
+
864  }
+
865 
+
866  nssv_constexpr size_type find( CharT const * s, size_type pos, size_type n ) const // (3)
+
867  {
+
868  return find( basic_string_view( s, n ), pos );
+
869  }
+
870 
+
871  nssv_constexpr size_type find( CharT const * s, size_type pos = 0 ) const // (4)
+
872  {
+
873  return find( basic_string_view( s ), pos );
+
874  }
+
875 
+
876  // rfind(), 4x:
+
877 
+
878  nssv_constexpr14 size_type rfind( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1)
+
879  {
+
880  if ( size() < v.size() )
+
881  {
+
882  return npos;
+
883  }
+
884 
+
885  if ( v.empty() )
+
886  {
+
887  return (std::min)( size(), pos );
+
888  }
+
889 
+
890  const_iterator last = cbegin() + (std::min)( size() - v.size(), pos ) + v.size();
+
891  const_iterator result = std::find_end( cbegin(), last, v.cbegin(), v.cend(), Traits::eq );
+
892 
+
893  return result != last ? size_type( result - cbegin() ) : npos;
+
894  }
+
895 
+
896  nssv_constexpr14 size_type rfind( CharT c, size_type pos = npos ) const nssv_noexcept // (2)
+
897  {
+
898  return rfind( basic_string_view( &c, 1 ), pos );
+
899  }
+
900 
+
901  nssv_constexpr14 size_type rfind( CharT const * s, size_type pos, size_type n ) const // (3)
+
902  {
+
903  return rfind( basic_string_view( s, n ), pos );
+
904  }
+
905 
+
906  nssv_constexpr14 size_type rfind( CharT const * s, size_type pos = npos ) const // (4)
+
907  {
+
908  return rfind( basic_string_view( s ), pos );
+
909  }
+
910 
+
911  // find_first_of(), 4x:
+
912 
+
913  nssv_constexpr size_type find_first_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
+
914  {
+
915  return pos >= size()
+
916  ? npos
+
917  : to_pos( std::find_first_of( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) );
+
918  }
+
919 
+
920  nssv_constexpr size_type find_first_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2)
+
921  {
+
922  return find_first_of( basic_string_view( &c, 1 ), pos );
+
923  }
+
924 
+
925  nssv_constexpr size_type find_first_of( CharT const * s, size_type pos, size_type n ) const // (3)
+
926  {
+
927  return find_first_of( basic_string_view( s, n ), pos );
+
928  }
+
929 
+
930  nssv_constexpr size_type find_first_of( CharT const * s, size_type pos = 0 ) const // (4)
+
931  {
+
932  return find_first_of( basic_string_view( s ), pos );
+
933  }
+
934 
+
935  // find_last_of(), 4x:
+
936 
+
937  nssv_constexpr size_type find_last_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1)
+
938  {
+
939  return empty()
+
940  ? npos
+
941  : pos >= size()
+
942  ? find_last_of( v, size() - 1 )
+
943  : to_pos( std::find_first_of( const_reverse_iterator( cbegin() + pos + 1 ), crend(), v.cbegin(), v.cend(), Traits::eq ) );
+
944  }
+
945 
+
946  nssv_constexpr size_type find_last_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2)
+
947  {
+
948  return find_last_of( basic_string_view( &c, 1 ), pos );
+
949  }
+
950 
+
951  nssv_constexpr size_type find_last_of( CharT const * s, size_type pos, size_type count ) const // (3)
+
952  {
+
953  return find_last_of( basic_string_view( s, count ), pos );
+
954  }
+
955 
+
956  nssv_constexpr size_type find_last_of( CharT const * s, size_type pos = npos ) const // (4)
+
957  {
+
958  return find_last_of( basic_string_view( s ), pos );
+
959  }
+
960 
+
961  // find_first_not_of(), 4x:
+
962 
+
963  nssv_constexpr size_type find_first_not_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
+
964  {
+
965  return pos >= size()
+
966  ? npos
+
967  : to_pos( std::find_if( cbegin() + pos, cend(), not_in_view( v ) ) );
+
968  }
+
969 
+
970  nssv_constexpr size_type find_first_not_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2)
+
971  {
+
972  return find_first_not_of( basic_string_view( &c, 1 ), pos );
+
973  }
974 
-
975 private:
-
976  struct not_in_view
-
977  {
-
978  const basic_string_view v;
+
975  nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos, size_type count ) const // (3)
+
976  {
+
977  return find_first_not_of( basic_string_view( s, count ), pos );
+
978  }
979 
-
980  nssv_constexpr explicit not_in_view( basic_string_view v_ ) : v( v_ ) {}
-
981 
-
982  nssv_constexpr bool operator()( CharT c ) const
-
983  {
-
984  return npos == v.find_first_of( c );
-
985  }
-
986  };
-
987 
-
988  nssv_constexpr size_type to_pos( const_iterator it ) const
-
989  {
-
990  return it == cend() ? npos : size_type( it - cbegin() );
-
991  }
-
992 
-
993  nssv_constexpr size_type to_pos( const_reverse_iterator it ) const
-
994  {
-
995  return it == crend() ? npos : size_type( crend() - it - 1 );
-
996  }
-
997 
-
998  nssv_constexpr const_reference data_at( size_type pos ) const
-
999  {
-
1000 #if nssv_BETWEEN( nssv_COMPILER_GNUC_VERSION, 1, 500 )
-
1001  return data_[pos];
-
1002 #else
-
1003  return assert( pos < size() ), data_[pos];
-
1004 #endif
-
1005  }
-
1006 
-
1007 private:
-
1008  const_pointer data_;
-
1009  size_type size_;
+
980  nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos = 0 ) const // (4)
+
981  {
+
982  return find_first_not_of( basic_string_view( s ), pos );
+
983  }
+
984 
+
985  // find_last_not_of(), 4x:
+
986 
+
987  nssv_constexpr size_type find_last_not_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1)
+
988  {
+
989  return empty()
+
990  ? npos
+
991  : pos >= size()
+
992  ? find_last_not_of( v, size() - 1 )
+
993  : to_pos( std::find_if( const_reverse_iterator( cbegin() + pos + 1 ), crend(), not_in_view( v ) ) );
+
994  }
+
995 
+
996  nssv_constexpr size_type find_last_not_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2)
+
997  {
+
998  return find_last_not_of( basic_string_view( &c, 1 ), pos );
+
999  }
+
1000 
+
1001  nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos, size_type count ) const // (3)
+
1002  {
+
1003  return find_last_not_of( basic_string_view( s, count ), pos );
+
1004  }
+
1005 
+
1006  nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos = npos ) const // (4)
+
1007  {
+
1008  return find_last_not_of( basic_string_view( s ), pos );
+
1009  }
1010 
-
1011 public:
-
1012 #if nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS
-
1013 
-
1014  template< class Allocator >
-
1015  basic_string_view( std::basic_string<CharT, Traits, Allocator> const & s ) nssv_noexcept
-
1016  : data_( s.data() )
-
1017  , size_( s.size() )
-
1018  {}
-
1019 
-
1020 #if nssv_HAVE_EXPLICIT_CONVERSION
-
1021 
-
1022  template< class Allocator >
-
1023  explicit operator std::basic_string<CharT, Traits, Allocator>() const
-
1024  {
-
1025  return to_string( Allocator() );
-
1026  }
+
1011  // Constants:
+
1012 
+
1013 #if nssv_CPP17_OR_GREATER
+
1014  static nssv_constexpr size_type npos = size_type(-1);
+
1015 #elif nssv_CPP11_OR_GREATER
+
1016  enum : size_type { npos = size_type(-1) };
+
1017 #else
+
1018  enum { npos = size_type(-1) };
+
1019 #endif
+
1020 
+
1021 private:
+
1022  struct not_in_view
+
1023  {
+
1024  const basic_string_view v;
+
1025 
+
1026  nssv_constexpr explicit not_in_view( basic_string_view v_ ) : v( v_ ) {}
1027 
-
1028 #endif // nssv_HAVE_EXPLICIT_CONVERSION
-
1029 
-
1030 #if nssv_CPP11_OR_GREATER
-
1031 
-
1032  template< class Allocator = std::allocator<CharT> >
-
1033  std::basic_string<CharT, Traits, Allocator>
-
1034  to_string( Allocator const & a = Allocator() ) const
+
1028  nssv_constexpr bool operator()( CharT c ) const
+
1029  {
+
1030  return npos == v.find_first_of( c );
+
1031  }
+
1032  };
+
1033 
+
1034  nssv_constexpr size_type to_pos( const_iterator it ) const
1035  {
-
1036  return std::basic_string<CharT, Traits, Allocator>( begin(), end(), a );
+
1036  return it == cend() ? npos : size_type( it - cbegin() );
1037  }
1038 
-
1039 #else
-
1040 
-
1041  std::basic_string<CharT, Traits>
-
1042  to_string() const
-
1043  {
-
1044  return std::basic_string<CharT, Traits>( begin(), end() );
-
1045  }
-
1046 
-
1047  template< class Allocator >
-
1048  std::basic_string<CharT, Traits, Allocator>
-
1049  to_string( Allocator const & a ) const
-
1050  {
-
1051  return std::basic_string<CharT, Traits, Allocator>( begin(), end(), a );
-
1052  }
-
1053 
-
1054 #endif // nssv_CPP11_OR_GREATER
-
1055 
-
1056 #endif // nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS
-
1057 };
-
1058 
-
1059 //
-
1060 // Non-member functions:
-
1061 //
-
1062 
-
1063 // 24.4.3 Non-member comparison functions:
-
1064 // lexicographically compare two string views (function template):
+
1039  nssv_constexpr size_type to_pos( const_reverse_iterator it ) const
+
1040  {
+
1041  return it == crend() ? npos : size_type( crend() - it - 1 );
+
1042  }
+
1043 
+
1044  nssv_constexpr const_reference data_at( size_type pos ) const
+
1045  {
+
1046 #if nssv_BETWEEN( nssv_COMPILER_GNUC_VERSION, 1, 500 )
+
1047  return data_[pos];
+
1048 #else
+
1049  return assert( pos < size() ), data_[pos];
+
1050 #endif
+
1051  }
+
1052 
+
1053 private:
+
1054  const_pointer data_;
+
1055  size_type size_;
+
1056 
+
1057 public:
+
1058 #if nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS
+
1059 
+
1060  template< class Allocator >
+
1061  basic_string_view( std::basic_string<CharT, Traits, Allocator> const & s ) nssv_noexcept
+
1062  : data_( s.data() )
+
1063  , size_( s.size() )
+
1064  {}
1065 
-
1066 template< class CharT, class Traits >
-
1067 nssv_constexpr bool operator== (
-
1068  basic_string_view <CharT, Traits> lhs,
-
1069  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1070 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
-
1071 
-
1072 template< class CharT, class Traits >
-
1073 nssv_constexpr bool operator!= (
-
1074  basic_string_view <CharT, Traits> lhs,
-
1075  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1076 { return !( lhs == rhs ); }
+
1066 #if nssv_HAVE_EXPLICIT_CONVERSION
+
1067 
+
1068  template< class Allocator >
+
1069  explicit operator std::basic_string<CharT, Traits, Allocator>() const
+
1070  {
+
1071  return to_string( Allocator() );
+
1072  }
+
1073 
+
1074 #endif // nssv_HAVE_EXPLICIT_CONVERSION
+
1075 
+
1076 #if nssv_CPP11_OR_GREATER
1077 
-
1078 template< class CharT, class Traits >
-
1079 nssv_constexpr bool operator< (
-
1080  basic_string_view <CharT, Traits> lhs,
-
1081  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1082 { return lhs.compare( rhs ) < 0; }
-
1083 
-
1084 template< class CharT, class Traits >
-
1085 nssv_constexpr bool operator<= (
-
1086  basic_string_view <CharT, Traits> lhs,
-
1087  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1088 { return lhs.compare( rhs ) <= 0; }
-
1089 
-
1090 template< class CharT, class Traits >
-
1091 nssv_constexpr bool operator> (
-
1092  basic_string_view <CharT, Traits> lhs,
-
1093  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1094 { return lhs.compare( rhs ) > 0; }
-
1095 
-
1096 template< class CharT, class Traits >
-
1097 nssv_constexpr bool operator>= (
-
1098  basic_string_view <CharT, Traits> lhs,
-
1099  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1100 { return lhs.compare( rhs ) >= 0; }
+
1078  template< class Allocator = std::allocator<CharT> >
+
1079  std::basic_string<CharT, Traits, Allocator>
+
1080  to_string( Allocator const & a = Allocator() ) const
+
1081  {
+
1082  return std::basic_string<CharT, Traits, Allocator>( begin(), end(), a );
+
1083  }
+
1084 
+
1085 #else
+
1086 
+
1087  std::basic_string<CharT, Traits>
+
1088  to_string() const
+
1089  {
+
1090  return std::basic_string<CharT, Traits>( begin(), end() );
+
1091  }
+
1092 
+
1093  template< class Allocator >
+
1094  std::basic_string<CharT, Traits, Allocator>
+
1095  to_string( Allocator const & a ) const
+
1096  {
+
1097  return std::basic_string<CharT, Traits, Allocator>( begin(), end(), a );
+
1098  }
+
1099 
+
1100 #endif // nssv_CPP11_OR_GREATER
1101 
-
1102 // Let S be basic_string_view<CharT, Traits>, and sv be an instance of S.
-
1103 // Implementations shall provide sufficient additional overloads marked
-
1104 // constexpr and noexcept so that an object t with an implicit conversion
-
1105 // to S can be compared according to Table 67.
-
1106 
-
1107 #if ! nssv_CPP11_OR_GREATER || nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 100, 141 )
+
1102 #endif // nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS
+
1103 };
+
1104 
+
1105 //
+
1106 // Non-member functions:
+
1107 //
1108 
-
1109 // accommodate for older compilers:
-
1110 
-
1111 // ==
-
1112 
-
1113 template< class CharT, class Traits>
-
1114 nssv_constexpr bool operator==(
-
1115  basic_string_view<CharT, Traits> lhs,
-
1116  CharT const * rhs ) nssv_noexcept
-
1117 { return lhs.size() == detail::length( rhs ) && lhs.compare( rhs ) == 0; }
-
1118 
-
1119 template< class CharT, class Traits>
-
1120 nssv_constexpr bool operator==(
-
1121  CharT const * lhs,
-
1122  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
-
1123 { return detail::length( lhs ) == rhs.size() && rhs.compare( lhs ) == 0; }
-
1124 
-
1125 template< class CharT, class Traits>
-
1126 nssv_constexpr bool operator==(
-
1127  basic_string_view<CharT, Traits> lhs,
-
1128  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
-
1129 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
-
1130 
-
1131 template< class CharT, class Traits>
-
1132 nssv_constexpr bool operator==(
-
1133  std::basic_string<CharT, Traits> rhs,
-
1134  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
-
1135 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
-
1136 
-
1137 // !=
-
1138 
-
1139 template< class CharT, class Traits>
-
1140 nssv_constexpr bool operator!=(
-
1141  basic_string_view<CharT, Traits> lhs,
-
1142  CharT const * rhs ) nssv_noexcept
-
1143 { return !( lhs == rhs ); }
-
1144 
-
1145 template< class CharT, class Traits>
-
1146 nssv_constexpr bool operator!=(
-
1147  CharT const * lhs,
-
1148  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
-
1149 { return !( lhs == rhs ); }
-
1150 
-
1151 template< class CharT, class Traits>
-
1152 nssv_constexpr bool operator!=(
-
1153  basic_string_view<CharT, Traits> lhs,
-
1154  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
-
1155 { return !( lhs == rhs ); }
+
1109 // 24.4.3 Non-member comparison functions:
+
1110 // lexicographically compare two string views (function template):
+
1111 
+
1112 template< class CharT, class Traits >
+
1113 nssv_constexpr bool operator== (
+
1114  basic_string_view <CharT, Traits> lhs,
+
1115  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1116 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
+
1117 
+
1118 template< class CharT, class Traits >
+
1119 nssv_constexpr bool operator!= (
+
1120  basic_string_view <CharT, Traits> lhs,
+
1121  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1122 { return !( lhs == rhs ); }
+
1123 
+
1124 template< class CharT, class Traits >
+
1125 nssv_constexpr bool operator< (
+
1126  basic_string_view <CharT, Traits> lhs,
+
1127  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1128 { return lhs.compare( rhs ) < 0; }
+
1129 
+
1130 template< class CharT, class Traits >
+
1131 nssv_constexpr bool operator<= (
+
1132  basic_string_view <CharT, Traits> lhs,
+
1133  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1134 { return lhs.compare( rhs ) <= 0; }
+
1135 
+
1136 template< class CharT, class Traits >
+
1137 nssv_constexpr bool operator> (
+
1138  basic_string_view <CharT, Traits> lhs,
+
1139  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1140 { return lhs.compare( rhs ) > 0; }
+
1141 
+
1142 template< class CharT, class Traits >
+
1143 nssv_constexpr bool operator>= (
+
1144  basic_string_view <CharT, Traits> lhs,
+
1145  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1146 { return lhs.compare( rhs ) >= 0; }
+
1147 
+
1148 // Let S be basic_string_view<CharT, Traits>, and sv be an instance of S.
+
1149 // Implementations shall provide sufficient additional overloads marked
+
1150 // constexpr and noexcept so that an object t with an implicit conversion
+
1151 // to S can be compared according to Table 67.
+
1152 
+
1153 #if ! nssv_CPP11_OR_GREATER || nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 100, 141 )
+
1154 
+
1155 // accommodate for older compilers:
1156 
-
1157 template< class CharT, class Traits>
-
1158 nssv_constexpr bool operator!=(
-
1159  std::basic_string<CharT, Traits> rhs,
-
1160  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
-
1161 { return !( lhs == rhs ); }
-
1162 
-
1163 // <
+
1157 // ==
+
1158 
+
1159 template< class CharT, class Traits>
+
1160 nssv_constexpr bool operator==(
+
1161  basic_string_view<CharT, Traits> lhs,
+
1162  CharT const * rhs ) nssv_noexcept
+
1163 { return lhs.size() == detail::length( rhs ) && lhs.compare( rhs ) == 0; }
1164 
1165 template< class CharT, class Traits>
-
1166 nssv_constexpr bool operator<(
-
1167  basic_string_view<CharT, Traits> lhs,
-
1168  CharT const * rhs ) nssv_noexcept
-
1169 { return lhs.compare( rhs ) < 0; }
+
1166 nssv_constexpr bool operator==(
+
1167  CharT const * lhs,
+
1168  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
+
1169 { return detail::length( lhs ) == rhs.size() && rhs.compare( lhs ) == 0; }
1170 
1171 template< class CharT, class Traits>
-
1172 nssv_constexpr bool operator<(
-
1173  CharT const * lhs,
-
1174  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
-
1175 { return rhs.compare( lhs ) > 0; }
+
1172 nssv_constexpr bool operator==(
+
1173  basic_string_view<CharT, Traits> lhs,
+
1174  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
+
1175 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
1176 
1177 template< class CharT, class Traits>
-
1178 nssv_constexpr bool operator<(
-
1179  basic_string_view<CharT, Traits> lhs,
-
1180  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
-
1181 { return lhs.compare( rhs ) < 0; }
+
1178 nssv_constexpr bool operator==(
+
1179  std::basic_string<CharT, Traits> rhs,
+
1180  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
+
1181 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
1182 
-
1183 template< class CharT, class Traits>
-
1184 nssv_constexpr bool operator<(
-
1185  std::basic_string<CharT, Traits> rhs,
-
1186  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
-
1187 { return rhs.compare( lhs ) > 0; }
-
1188 
-
1189 // <=
+
1183 // !=
+
1184 
+
1185 template< class CharT, class Traits>
+
1186 nssv_constexpr bool operator!=(
+
1187  basic_string_view<CharT, Traits> lhs,
+
1188  CharT const * rhs ) nssv_noexcept
+
1189 { return !( lhs == rhs ); }
1190 
1191 template< class CharT, class Traits>
-
1192 nssv_constexpr bool operator<=(
-
1193  basic_string_view<CharT, Traits> lhs,
-
1194  CharT const * rhs ) nssv_noexcept
-
1195 { return lhs.compare( rhs ) <= 0; }
+
1192 nssv_constexpr bool operator!=(
+
1193  CharT const * lhs,
+
1194  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
+
1195 { return !( lhs == rhs ); }
1196 
1197 template< class CharT, class Traits>
-
1198 nssv_constexpr bool operator<=(
-
1199  CharT const * lhs,
-
1200  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
-
1201 { return rhs.compare( lhs ) >= 0; }
+
1198 nssv_constexpr bool operator!=(
+
1199  basic_string_view<CharT, Traits> lhs,
+
1200  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
+
1201 { return !( lhs == rhs ); }
1202 
1203 template< class CharT, class Traits>
-
1204 nssv_constexpr bool operator<=(
-
1205  basic_string_view<CharT, Traits> lhs,
-
1206  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
-
1207 { return lhs.compare( rhs ) <= 0; }
+
1204 nssv_constexpr bool operator!=(
+
1205  std::basic_string<CharT, Traits> rhs,
+
1206  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
+
1207 { return !( lhs == rhs ); }
1208 
-
1209 template< class CharT, class Traits>
-
1210 nssv_constexpr bool operator<=(
-
1211  std::basic_string<CharT, Traits> rhs,
-
1212  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
-
1213 { return rhs.compare( lhs ) >= 0; }
-
1214 
-
1215 // >
+
1209 // <
+
1210 
+
1211 template< class CharT, class Traits>
+
1212 nssv_constexpr bool operator<(
+
1213  basic_string_view<CharT, Traits> lhs,
+
1214  CharT const * rhs ) nssv_noexcept
+
1215 { return lhs.compare( rhs ) < 0; }
1216 
1217 template< class CharT, class Traits>
-
1218 nssv_constexpr bool operator>(
-
1219  basic_string_view<CharT, Traits> lhs,
-
1220  CharT const * rhs ) nssv_noexcept
-
1221 { return lhs.compare( rhs ) > 0; }
+
1218 nssv_constexpr bool operator<(
+
1219  CharT const * lhs,
+
1220  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
+
1221 { return rhs.compare( lhs ) > 0; }
1222 
1223 template< class CharT, class Traits>
-
1224 nssv_constexpr bool operator>(
-
1225  CharT const * lhs,
-
1226  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
-
1227 { return rhs.compare( lhs ) < 0; }
+
1224 nssv_constexpr bool operator<(
+
1225  basic_string_view<CharT, Traits> lhs,
+
1226  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
+
1227 { return lhs.compare( rhs ) < 0; }
1228 
1229 template< class CharT, class Traits>
-
1230 nssv_constexpr bool operator>(
-
1231  basic_string_view<CharT, Traits> lhs,
-
1232  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
-
1233 { return lhs.compare( rhs ) > 0; }
+
1230 nssv_constexpr bool operator<(
+
1231  std::basic_string<CharT, Traits> rhs,
+
1232  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
+
1233 { return rhs.compare( lhs ) > 0; }
1234 
-
1235 template< class CharT, class Traits>
-
1236 nssv_constexpr bool operator>(
-
1237  std::basic_string<CharT, Traits> rhs,
-
1238  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
-
1239 { return rhs.compare( lhs ) < 0; }
-
1240 
-
1241 // >=
+
1235 // <=
+
1236 
+
1237 template< class CharT, class Traits>
+
1238 nssv_constexpr bool operator<=(
+
1239  basic_string_view<CharT, Traits> lhs,
+
1240  CharT const * rhs ) nssv_noexcept
+
1241 { return lhs.compare( rhs ) <= 0; }
1242 
1243 template< class CharT, class Traits>
-
1244 nssv_constexpr bool operator>=(
-
1245  basic_string_view<CharT, Traits> lhs,
-
1246  CharT const * rhs ) nssv_noexcept
-
1247 { return lhs.compare( rhs ) >= 0; }
+
1244 nssv_constexpr bool operator<=(
+
1245  CharT const * lhs,
+
1246  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
+
1247 { return rhs.compare( lhs ) >= 0; }
1248 
1249 template< class CharT, class Traits>
-
1250 nssv_constexpr bool operator>=(
-
1251  CharT const * lhs,
-
1252  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
-
1253 { return rhs.compare( lhs ) <= 0; }
+
1250 nssv_constexpr bool operator<=(
+
1251  basic_string_view<CharT, Traits> lhs,
+
1252  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
+
1253 { return lhs.compare( rhs ) <= 0; }
1254 
1255 template< class CharT, class Traits>
-
1256 nssv_constexpr bool operator>=(
-
1257  basic_string_view<CharT, Traits> lhs,
-
1258  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
-
1259 { return lhs.compare( rhs ) >= 0; }
+
1256 nssv_constexpr bool operator<=(
+
1257  std::basic_string<CharT, Traits> rhs,
+
1258  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
+
1259 { return rhs.compare( lhs ) >= 0; }
1260 
-
1261 template< class CharT, class Traits>
-
1262 nssv_constexpr bool operator>=(
-
1263  std::basic_string<CharT, Traits> rhs,
-
1264  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
-
1265 { return rhs.compare( lhs ) <= 0; }
-
1266 
-
1267 #else // newer compilers:
+
1261 // >
+
1262 
+
1263 template< class CharT, class Traits>
+
1264 nssv_constexpr bool operator>(
+
1265  basic_string_view<CharT, Traits> lhs,
+
1266  CharT const * rhs ) nssv_noexcept
+
1267 { return lhs.compare( rhs ) > 0; }
1268 
-
1269 #define nssv_BASIC_STRING_VIEW_I(T,U) typename std::decay< basic_string_view<T,U> >::type
-
1270 
-
1271 #if defined(_MSC_VER) // issue 40
-
1272 # define nssv_MSVC_ORDER(x) , int=x
-
1273 #else
-
1274 # define nssv_MSVC_ORDER(x) /*, int=x*/
-
1275 #endif
-
1276 
-
1277 // ==
-
1278 
-
1279 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
-
1280 nssv_constexpr bool operator==(
-
1281  basic_string_view <CharT, Traits> lhs,
-
1282  nssv_BASIC_STRING_VIEW_I(CharT, Traits) rhs ) nssv_noexcept
-
1283 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
-
1284 
-
1285 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
-
1286 nssv_constexpr bool operator==(
-
1287  nssv_BASIC_STRING_VIEW_I(CharT, Traits) lhs,
-
1288  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
-
1289 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
-
1290 
-
1291 // !=
-
1292 
-
1293 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
-
1294 nssv_constexpr bool operator!= (
-
1295  basic_string_view < CharT, Traits > lhs,
-
1296  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
-
1297 { return !( lhs == rhs ); }
-
1298 
-
1299 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
-
1300 nssv_constexpr bool operator!= (
-
1301  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
-
1302  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
-
1303 { return !( lhs == rhs ); }
-
1304 
-
1305 // <
+
1269 template< class CharT, class Traits>
+
1270 nssv_constexpr bool operator>(
+
1271  CharT const * lhs,
+
1272  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
+
1273 { return rhs.compare( lhs ) < 0; }
+
1274 
+
1275 template< class CharT, class Traits>
+
1276 nssv_constexpr bool operator>(
+
1277  basic_string_view<CharT, Traits> lhs,
+
1278  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
+
1279 { return lhs.compare( rhs ) > 0; }
+
1280 
+
1281 template< class CharT, class Traits>
+
1282 nssv_constexpr bool operator>(
+
1283  std::basic_string<CharT, Traits> rhs,
+
1284  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
+
1285 { return rhs.compare( lhs ) < 0; }
+
1286 
+
1287 // >=
+
1288 
+
1289 template< class CharT, class Traits>
+
1290 nssv_constexpr bool operator>=(
+
1291  basic_string_view<CharT, Traits> lhs,
+
1292  CharT const * rhs ) nssv_noexcept
+
1293 { return lhs.compare( rhs ) >= 0; }
+
1294 
+
1295 template< class CharT, class Traits>
+
1296 nssv_constexpr bool operator>=(
+
1297  CharT const * lhs,
+
1298  basic_string_view<CharT, Traits> rhs ) nssv_noexcept
+
1299 { return rhs.compare( lhs ) <= 0; }
+
1300 
+
1301 template< class CharT, class Traits>
+
1302 nssv_constexpr bool operator>=(
+
1303  basic_string_view<CharT, Traits> lhs,
+
1304  std::basic_string<CharT, Traits> rhs ) nssv_noexcept
+
1305 { return lhs.compare( rhs ) >= 0; }
1306 
-
1307 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
-
1308 nssv_constexpr bool operator< (
-
1309  basic_string_view < CharT, Traits > lhs,
-
1310  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
-
1311 { return lhs.compare( rhs ) < 0; }
+
1307 template< class CharT, class Traits>
+
1308 nssv_constexpr bool operator>=(
+
1309  std::basic_string<CharT, Traits> rhs,
+
1310  basic_string_view<CharT, Traits> lhs ) nssv_noexcept
+
1311 { return rhs.compare( lhs ) <= 0; }
1312 
-
1313 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
-
1314 nssv_constexpr bool operator< (
-
1315  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
-
1316  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
-
1317 { return lhs.compare( rhs ) < 0; }
-
1318 
-
1319 // <=
-
1320 
-
1321 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
-
1322 nssv_constexpr bool operator<= (
-
1323  basic_string_view < CharT, Traits > lhs,
-
1324  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
-
1325 { return lhs.compare( rhs ) <= 0; }
-
1326 
-
1327 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
-
1328 nssv_constexpr bool operator<= (
-
1329  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
-
1330  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
-
1331 { return lhs.compare( rhs ) <= 0; }
-
1332 
-
1333 // >
-
1334 
-
1335 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
-
1336 nssv_constexpr bool operator> (
-
1337  basic_string_view < CharT, Traits > lhs,
-
1338  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
-
1339 { return lhs.compare( rhs ) > 0; }
-
1340 
-
1341 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
-
1342 nssv_constexpr bool operator> (
-
1343  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
-
1344  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
-
1345 { return lhs.compare( rhs ) > 0; }
-
1346 
-
1347 // >=
-
1348 
-
1349 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
-
1350 nssv_constexpr bool operator>= (
-
1351  basic_string_view < CharT, Traits > lhs,
-
1352  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
-
1353 { return lhs.compare( rhs ) >= 0; }
-
1354 
-
1355 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
-
1356 nssv_constexpr bool operator>= (
-
1357  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
-
1358  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
-
1359 { return lhs.compare( rhs ) >= 0; }
-
1360 
-
1361 #undef nssv_MSVC_ORDER
-
1362 #undef nssv_BASIC_STRING_VIEW_I
-
1363 
-
1364 #endif // compiler-dependent approach to comparisons
-
1365 
-
1366 // 24.4.4 Inserters and extractors:
-
1367 
-
1368 #if ! nssv_CONFIG_NO_STREAM_INSERTION
-
1369 
-
1370 namespace detail {
-
1371 
-
1372 template< class Stream >
-
1373 void write_padding( Stream & os, std::streamsize n )
-
1374 {
-
1375  for ( std::streamsize i = 0; i < n; ++i )
-
1376  os.rdbuf()->sputc( os.fill() );
-
1377 }
+
1313 #else // newer compilers:
+
1314 
+
1315 #define nssv_BASIC_STRING_VIEW_I(T,U) typename std::decay< basic_string_view<T,U> >::type
+
1316 
+
1317 #if defined(_MSC_VER) // issue 40
+
1318 # define nssv_MSVC_ORDER(x) , int=x
+
1319 #else
+
1320 # define nssv_MSVC_ORDER(x) /*, int=x*/
+
1321 #endif
+
1322 
+
1323 // ==
+
1324 
+
1325 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
+
1326 nssv_constexpr bool operator==(
+
1327  basic_string_view <CharT, Traits> lhs,
+
1328  nssv_BASIC_STRING_VIEW_I(CharT, Traits) rhs ) nssv_noexcept
+
1329 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
+
1330 
+
1331 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
+
1332 nssv_constexpr bool operator==(
+
1333  nssv_BASIC_STRING_VIEW_I(CharT, Traits) lhs,
+
1334  basic_string_view <CharT, Traits> rhs ) nssv_noexcept
+
1335 { return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; }
+
1336 
+
1337 // !=
+
1338 
+
1339 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
+
1340 nssv_constexpr bool operator!= (
+
1341  basic_string_view < CharT, Traits > lhs,
+
1342  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
+
1343 { return !( lhs == rhs ); }
+
1344 
+
1345 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
+
1346 nssv_constexpr bool operator!= (
+
1347  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
+
1348  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
+
1349 { return !( lhs == rhs ); }
+
1350 
+
1351 // <
+
1352 
+
1353 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
+
1354 nssv_constexpr bool operator< (
+
1355  basic_string_view < CharT, Traits > lhs,
+
1356  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
+
1357 { return lhs.compare( rhs ) < 0; }
+
1358 
+
1359 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
+
1360 nssv_constexpr bool operator< (
+
1361  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
+
1362  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
+
1363 { return lhs.compare( rhs ) < 0; }
+
1364 
+
1365 // <=
+
1366 
+
1367 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
+
1368 nssv_constexpr bool operator<= (
+
1369  basic_string_view < CharT, Traits > lhs,
+
1370  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
+
1371 { return lhs.compare( rhs ) <= 0; }
+
1372 
+
1373 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
+
1374 nssv_constexpr bool operator<= (
+
1375  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
+
1376  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
+
1377 { return lhs.compare( rhs ) <= 0; }
1378 
-
1379 template< class Stream, class View >
-
1380 Stream & write_to_stream( Stream & os, View const & sv )
-
1381 {
-
1382  typename Stream::sentry sentry( os );
-
1383 
-
1384  if ( !os )
-
1385  return os;
+
1379 // >
+
1380 
+
1381 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
+
1382 nssv_constexpr bool operator> (
+
1383  basic_string_view < CharT, Traits > lhs,
+
1384  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
+
1385 { return lhs.compare( rhs ) > 0; }
1386 
-
1387  const std::streamsize length = static_cast<std::streamsize>( sv.length() );
-
1388 
-
1389  // Whether, and how, to pad:
-
1390  const bool pad = ( length < os.width() );
-
1391  const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right;
+
1387 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
+
1388 nssv_constexpr bool operator> (
+
1389  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
+
1390  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
+
1391 { return lhs.compare( rhs ) > 0; }
1392 
-
1393  if ( left_pad )
-
1394  write_padding( os, os.width() - length );
-
1395 
-
1396  // Write span characters:
-
1397  os.rdbuf()->sputn( sv.begin(), length );
-
1398 
-
1399  if ( pad && !left_pad )
-
1400  write_padding( os, os.width() - length );
-
1401 
-
1402  // Reset output stream width:
-
1403  os.width( 0 );
-
1404 
-
1405  return os;
-
1406 }
-
1407 
-
1408 } // namespace detail
+
1393 // >=
+
1394 
+
1395 template< class CharT, class Traits nssv_MSVC_ORDER(1) >
+
1396 nssv_constexpr bool operator>= (
+
1397  basic_string_view < CharT, Traits > lhs,
+
1398  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept
+
1399 { return lhs.compare( rhs ) >= 0; }
+
1400 
+
1401 template< class CharT, class Traits nssv_MSVC_ORDER(2) >
+
1402 nssv_constexpr bool operator>= (
+
1403  nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs,
+
1404  basic_string_view < CharT, Traits > rhs ) nssv_noexcept
+
1405 { return lhs.compare( rhs ) >= 0; }
+
1406 
+
1407 #undef nssv_MSVC_ORDER
+
1408 #undef nssv_BASIC_STRING_VIEW_I
1409 
-
1410 template< class CharT, class Traits >
-
1411 std::basic_ostream<CharT, Traits> &
-
1412 operator<<(
-
1413  std::basic_ostream<CharT, Traits>& os,
-
1414  basic_string_view <CharT, Traits> sv )
-
1415 {
-
1416  return detail::write_to_stream( os, sv );
-
1417 }
-
1418 
-
1419 #endif // nssv_CONFIG_NO_STREAM_INSERTION
-
1420 
-
1421 // Several typedefs for common character types are provided:
-
1422 
-
1423 typedef basic_string_view<char> string_view;
-
1424 typedef basic_string_view<wchar_t> wstring_view;
-
1425 #if nssv_HAVE_WCHAR16_T
-
1426 typedef basic_string_view<char16_t> u16string_view;
-
1427 typedef basic_string_view<char32_t> u32string_view;
-
1428 #endif
+
1410 #endif // compiler-dependent approach to comparisons
+
1411 
+
1412 // 24.4.4 Inserters and extractors:
+
1413 
+
1414 #if ! nssv_CONFIG_NO_STREAM_INSERTION
+
1415 
+
1416 namespace detail {
+
1417 
+
1418 template< class Stream >
+
1419 void write_padding( Stream & os, std::streamsize n )
+
1420 {
+
1421  for ( std::streamsize i = 0; i < n; ++i )
+
1422  os.rdbuf()->sputc( os.fill() );
+
1423 }
+
1424 
+
1425 template< class Stream, class View >
+
1426 Stream & write_to_stream( Stream & os, View const & sv )
+
1427 {
+
1428  typename Stream::sentry sentry( os );
1429 
-
1430 }} // namespace nonstd::sv_lite
-
1431 
-
1432 //
-
1433 // 24.4.6 Suffix for basic_string_view literals:
-
1434 //
-
1435 
-
1436 #if nssv_HAVE_USER_DEFINED_LITERALS
-
1437 
-
1438 namespace nonstd {
-
1439 nssv_inline_ns namespace literals {
-
1440 nssv_inline_ns namespace string_view_literals {
+
1430  if ( !sentry )
+
1431  return os;
+
1432 
+
1433  const std::streamsize length = static_cast<std::streamsize>( sv.length() );
+
1434 
+
1435  // Whether, and how, to pad:
+
1436  const bool pad = ( length < os.width() );
+
1437  const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right;
+
1438 
+
1439  if ( left_pad )
+
1440  write_padding( os, os.width() - length );
1441 
-
1442 #if nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS
-
1443 
-
1444 nssv_constexpr nonstd::sv_lite::string_view operator "" sv( const char* str, size_t len ) nssv_noexcept // (1)
-
1445 {
-
1446  return nonstd::sv_lite::string_view{ str, len };
-
1447 }
-
1448 
-
1449 nssv_constexpr nonstd::sv_lite::u16string_view operator "" sv( const char16_t* str, size_t len ) nssv_noexcept // (2)
-
1450 {
-
1451  return nonstd::sv_lite::u16string_view{ str, len };
+
1442  // Write span characters:
+
1443  os.rdbuf()->sputn( sv.begin(), length );
+
1444 
+
1445  if ( pad && !left_pad )
+
1446  write_padding( os, os.width() - length );
+
1447 
+
1448  // Reset output stream width:
+
1449  os.width( 0 );
+
1450 
+
1451  return os;
1452 }
1453 
-
1454 nssv_constexpr nonstd::sv_lite::u32string_view operator "" sv( const char32_t* str, size_t len ) nssv_noexcept // (3)
-
1455 {
-
1456  return nonstd::sv_lite::u32string_view{ str, len };
-
1457 }
-
1458 
-
1459 nssv_constexpr nonstd::sv_lite::wstring_view operator "" sv( const wchar_t* str, size_t len ) nssv_noexcept // (4)
-
1460 {
-
1461  return nonstd::sv_lite::wstring_view{ str, len };
-
1462 }
-
1463 
-
1464 #endif // nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS
-
1465 
-
1466 #if nssv_CONFIG_USR_SV_OPERATOR
-
1467 
-
1468 nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1)
-
1469 {
-
1470  return nonstd::sv_lite::string_view{ str, len };
-
1471 }
-
1472 
-
1473 nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2)
-
1474 {
-
1475  return nonstd::sv_lite::u16string_view{ str, len };
-
1476 }
+
1454 } // namespace detail
+
1455 
+
1456 template< class CharT, class Traits >
+
1457 std::basic_ostream<CharT, Traits> &
+
1458 operator<<(
+
1459  std::basic_ostream<CharT, Traits>& os,
+
1460  basic_string_view <CharT, Traits> sv )
+
1461 {
+
1462  return detail::write_to_stream( os, sv );
+
1463 }
+
1464 
+
1465 #endif // nssv_CONFIG_NO_STREAM_INSERTION
+
1466 
+
1467 // Several typedefs for common character types are provided:
+
1468 
+
1469 typedef basic_string_view<char> string_view;
+
1470 typedef basic_string_view<wchar_t> wstring_view;
+
1471 #if nssv_HAVE_WCHAR16_T
+
1472 typedef basic_string_view<char16_t> u16string_view;
+
1473 typedef basic_string_view<char32_t> u32string_view;
+
1474 #endif
+
1475 
+
1476 }} // namespace nonstd::sv_lite
1477 
-
1478 nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3)
-
1479 {
-
1480  return nonstd::sv_lite::u32string_view{ str, len };
-
1481 }
-
1482 
-
1483 nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4)
-
1484 {
-
1485  return nonstd::sv_lite::wstring_view{ str, len };
-
1486 }
+
1478 //
+
1479 // 24.4.6 Suffix for basic_string_view literals:
+
1480 //
+
1481 
+
1482 #if nssv_HAVE_USER_DEFINED_LITERALS
+
1483 
+
1484 namespace nonstd {
+
1485 nssv_inline_ns namespace literals {
+
1486 nssv_inline_ns namespace string_view_literals {
1487 
-
1488 #endif // nssv_CONFIG_USR_SV_OPERATOR
+
1488 #if nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS
1489 
-
1490 }}} // namespace nonstd::literals::string_view_literals
-
1491 
-
1492 #endif
-
1493 
-
1494 //
-
1495 // Extensions for std::string:
-
1496 //
-
1497 
-
1498 #if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
+
1490 nssv_constexpr nonstd::sv_lite::string_view operator "" sv( const char* str, size_t len ) nssv_noexcept // (1)
+
1491 {
+
1492  return nonstd::sv_lite::string_view{ str, len };
+
1493 }
+
1494 
+
1495 nssv_constexpr nonstd::sv_lite::u16string_view operator "" sv( const char16_t* str, size_t len ) nssv_noexcept // (2)
+
1496 {
+
1497  return nonstd::sv_lite::u16string_view{ str, len };
+
1498 }
1499 
-
1500 namespace nonstd {
-
1501 namespace sv_lite {
-
1502 
-
1503 // Exclude MSVC 14 (19.00): it yields ambiguous to_string():
+
1500 nssv_constexpr nonstd::sv_lite::u32string_view operator "" sv( const char32_t* str, size_t len ) nssv_noexcept // (3)
+
1501 {
+
1502  return nonstd::sv_lite::u32string_view{ str, len };
+
1503 }
1504 
-
1505 #if nssv_CPP11_OR_GREATER && nssv_COMPILER_MSVC_VERSION != 140
-
1506 
-
1507 template< class CharT, class Traits, class Allocator = std::allocator<CharT> >
-
1508 std::basic_string<CharT, Traits, Allocator>
-
1509 to_string( basic_string_view<CharT, Traits> v, Allocator const & a = Allocator() )
-
1510 {
-
1511  return std::basic_string<CharT,Traits, Allocator>( v.begin(), v.end(), a );
-
1512 }
+
1505 nssv_constexpr nonstd::sv_lite::wstring_view operator "" sv( const wchar_t* str, size_t len ) nssv_noexcept // (4)
+
1506 {
+
1507  return nonstd::sv_lite::wstring_view{ str, len };
+
1508 }
+
1509 
+
1510 #endif // nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS
+
1511 
+
1512 #if nssv_CONFIG_USR_SV_OPERATOR
1513 
-
1514 #else
-
1515 
-
1516 template< class CharT, class Traits >
-
1517 std::basic_string<CharT, Traits>
-
1518 to_string( basic_string_view<CharT, Traits> v )
-
1519 {
-
1520  return std::basic_string<CharT, Traits>( v.begin(), v.end() );
-
1521 }
-
1522 
-
1523 template< class CharT, class Traits, class Allocator >
-
1524 std::basic_string<CharT, Traits, Allocator>
-
1525 to_string( basic_string_view<CharT, Traits> v, Allocator const & a )
-
1526 {
-
1527  return std::basic_string<CharT, Traits, Allocator>( v.begin(), v.end(), a );
-
1528 }
-
1529 
-
1530 #endif // nssv_CPP11_OR_GREATER
-
1531 
-
1532 template< class CharT, class Traits, class Allocator >
-
1533 basic_string_view<CharT, Traits>
-
1534 to_string_view( std::basic_string<CharT, Traits, Allocator> const & s )
-
1535 {
-
1536  return basic_string_view<CharT, Traits>( s.data(), s.size() );
-
1537 }
-
1538 
-
1539 }} // namespace nonstd::sv_lite
-
1540 
-
1541 #endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
-
1542 
-
1543 //
-
1544 // make types and algorithms available in namespace nonstd:
-
1545 //
-
1546 
-
1547 namespace nonstd {
+
1514 nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1)
+
1515 {
+
1516  return nonstd::sv_lite::string_view{ str, len };
+
1517 }
+
1518 
+
1519 nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2)
+
1520 {
+
1521  return nonstd::sv_lite::u16string_view{ str, len };
+
1522 }
+
1523 
+
1524 nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3)
+
1525 {
+
1526  return nonstd::sv_lite::u32string_view{ str, len };
+
1527 }
+
1528 
+
1529 nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4)
+
1530 {
+
1531  return nonstd::sv_lite::wstring_view{ str, len };
+
1532 }
+
1533 
+
1534 #endif // nssv_CONFIG_USR_SV_OPERATOR
+
1535 
+
1536 }}} // namespace nonstd::literals::string_view_literals
+
1537 
+
1538 #endif
+
1539 
+
1540 //
+
1541 // Extensions for std::string:
+
1542 //
+
1543 
+
1544 #if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
+
1545 
+
1546 namespace nonstd {
+
1547 namespace sv_lite {
1548 
-
1549 using sv_lite::basic_string_view;
-
1550 using sv_lite::string_view;
-
1551 using sv_lite::wstring_view;
+
1549 // Exclude MSVC 14 (19.00): it yields ambiguous to_string():
+
1550 
+
1551 #if nssv_CPP11_OR_GREATER && nssv_COMPILER_MSVC_VERSION != 140
1552 
-
1553 #if nssv_HAVE_WCHAR16_T
-
1554 using sv_lite::u16string_view;
-
1555 #endif
-
1556 #if nssv_HAVE_WCHAR32_T
-
1557 using sv_lite::u32string_view;
-
1558 #endif
+
1553 template< class CharT, class Traits, class Allocator = std::allocator<CharT> >
+
1554 std::basic_string<CharT, Traits, Allocator>
+
1555 to_string( basic_string_view<CharT, Traits> v, Allocator const & a = Allocator() )
+
1556 {
+
1557  return std::basic_string<CharT,Traits, Allocator>( v.begin(), v.end(), a );
+
1558 }
1559 
-
1560 // literal "sv"
+
1560 #else
1561 
-
1562 using sv_lite::operator==;
-
1563 using sv_lite::operator!=;
-
1564 using sv_lite::operator<;
-
1565 using sv_lite::operator<=;
-
1566 using sv_lite::operator>;
-
1567 using sv_lite::operator>=;
+
1562 template< class CharT, class Traits >
+
1563 std::basic_string<CharT, Traits>
+
1564 to_string( basic_string_view<CharT, Traits> v )
+
1565 {
+
1566  return std::basic_string<CharT, Traits>( v.begin(), v.end() );
+
1567 }
1568 
-
1569 #if ! nssv_CONFIG_NO_STREAM_INSERTION
-
1570 using sv_lite::operator<<;
-
1571 #endif
-
1572 
-
1573 #if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
-
1574 using sv_lite::to_string;
-
1575 using sv_lite::to_string_view;
-
1576 #endif
+
1569 template< class CharT, class Traits, class Allocator >
+
1570 std::basic_string<CharT, Traits, Allocator>
+
1571 to_string( basic_string_view<CharT, Traits> v, Allocator const & a )
+
1572 {
+
1573  return std::basic_string<CharT, Traits, Allocator>( v.begin(), v.end(), a );
+
1574 }
+
1575 
+
1576 #endif // nssv_CPP11_OR_GREATER
1577 
-
1578 } // namespace nonstd
-
1579 
-
1580 // 24.4.5 Hash support (C++11):
-
1581 
-
1582 // Note: The hash value of a string view object is equal to the hash value of
-
1583 // the corresponding string object.
+
1578 template< class CharT, class Traits, class Allocator >
+
1579 basic_string_view<CharT, Traits>
+
1580 to_string_view( std::basic_string<CharT, Traits, Allocator> const & s )
+
1581 {
+
1582  return basic_string_view<CharT, Traits>( s.data(), s.size() );
+
1583 }
1584 
-
1585 #if nssv_HAVE_STD_HASH
+
1585 }} // namespace nonstd::sv_lite
1586 
-
1587 #include <functional>
+
1587 #endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
1588 
-
1589 namespace std {
-
1590 
-
1591 template<>
-
1592 struct hash< nonstd::string_view >
-
1593 {
-
1594 public:
-
1595  std::size_t operator()( nonstd::string_view v ) const nssv_noexcept
-
1596  {
-
1597  return std::hash<std::string>()( std::string( v.data(), v.size() ) );
-
1598  }
-
1599 };
-
1600 
-
1601 template<>
-
1602 struct hash< nonstd::wstring_view >
-
1603 {
-
1604 public:
-
1605  std::size_t operator()( nonstd::wstring_view v ) const nssv_noexcept
-
1606  {
-
1607  return std::hash<std::wstring>()( std::wstring( v.data(), v.size() ) );
-
1608  }
-
1609 };
-
1610 
-
1611 template<>
-
1612 struct hash< nonstd::u16string_view >
-
1613 {
-
1614 public:
-
1615  std::size_t operator()( nonstd::u16string_view v ) const nssv_noexcept
-
1616  {
-
1617  return std::hash<std::u16string>()( std::u16string( v.data(), v.size() ) );
-
1618  }
-
1619 };
-
1620 
-
1621 template<>
-
1622 struct hash< nonstd::u32string_view >
-
1623 {
-
1624 public:
-
1625  std::size_t operator()( nonstd::u32string_view v ) const nssv_noexcept
-
1626  {
-
1627  return std::hash<std::u32string>()( std::u32string( v.data(), v.size() ) );
-
1628  }
-
1629 };
+
1589 //
+
1590 // make types and algorithms available in namespace nonstd:
+
1591 //
+
1592 
+
1593 namespace nonstd {
+
1594 
+
1595 using sv_lite::basic_string_view;
+
1596 using sv_lite::string_view;
+
1597 using sv_lite::wstring_view;
+
1598 
+
1599 #if nssv_HAVE_WCHAR16_T
+
1600 using sv_lite::u16string_view;
+
1601 #endif
+
1602 #if nssv_HAVE_WCHAR32_T
+
1603 using sv_lite::u32string_view;
+
1604 #endif
+
1605 
+
1606 // literal "sv"
+
1607 
+
1608 using sv_lite::operator==;
+
1609 using sv_lite::operator!=;
+
1610 using sv_lite::operator<;
+
1611 using sv_lite::operator<=;
+
1612 using sv_lite::operator>;
+
1613 using sv_lite::operator>=;
+
1614 
+
1615 #if ! nssv_CONFIG_NO_STREAM_INSERTION
+
1616 using sv_lite::operator<<;
+
1617 #endif
+
1618 
+
1619 #if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS
+
1620 using sv_lite::to_string;
+
1621 using sv_lite::to_string_view;
+
1622 #endif
+
1623 
+
1624 } // namespace nonstd
+
1625 
+
1626 // 24.4.5 Hash support (C++11):
+
1627 
+
1628 // Note: The hash value of a string view object is equal to the hash value of
+
1629 // the corresponding string object.
1630 
-
1631 } // namespace std
+
1631 #if nssv_HAVE_STD_HASH
1632 
-
1633 #endif // nssv_HAVE_STD_HASH
+
1633 #include <functional>
1634 
-
1635 nssv_RESTORE_WARNINGS()
+
1635 namespace std {
1636 
-
1637 #endif // nssv_HAVE_STD_STRING_VIEW
-
1638 #endif // NONSTD_SV_LITE_H_INCLUDED
+
1637 template<>
+
1638 struct hash< nonstd::string_view >
+
1639 {
+
1640 public:
+
1641  std::size_t operator()( nonstd::string_view v ) const nssv_noexcept
+
1642  {
+
1643  return std::hash<std::string>()( std::string( v.data(), v.size() ) );
+
1644  }
+
1645 };
+
1646 
+
1647 template<>
+
1648 struct hash< nonstd::wstring_view >
+
1649 {
+
1650 public:
+
1651  std::size_t operator()( nonstd::wstring_view v ) const nssv_noexcept
+
1652  {
+
1653  return std::hash<std::wstring>()( std::wstring( v.data(), v.size() ) );
+
1654  }
+
1655 };
+
1656 
+
1657 template<>
+
1658 struct hash< nonstd::u16string_view >
+
1659 {
+
1660 public:
+
1661  std::size_t operator()( nonstd::u16string_view v ) const nssv_noexcept
+
1662  {
+
1663  return std::hash<std::u16string>()( std::u16string( v.data(), v.size() ) );
+
1664  }
+
1665 };
+
1666 
+
1667 template<>
+
1668 struct hash< nonstd::u32string_view >
+
1669 {
+
1670 public:
+
1671  std::size_t operator()( nonstd::u32string_view v ) const nssv_noexcept
+
1672  {
+
1673  return std::hash<std::u32string>()( std::u32string( v.data(), v.size() ) );
+
1674  }
+
1675 };
+
1676 
+
1677 } // namespace std
+
1678 
+
1679 #endif // nssv_HAVE_STD_HASH
+
1680 
+
1681 nssv_RESTORE_WARNINGS()
+
1682 
+
1683 #endif // nssv_HAVE_STD_STRING_VIEW
+
1684 #endif // NONSTD_SV_LITE_H_INCLUDED
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::operator==
simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept
Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user i...
Definition: raw_json_string-inl.h:129
simdjson::to_string
std::string to_string(T x)
Converts JSON to a string.
Definition: serialization.h:177