mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Small improvements for StringRef
* `operator[]` is constexpr * `operator<<` and `operator+=` are hidden friends
This commit is contained in:
		| @@ -126,8 +126,6 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) { | ||||
| } | ||||
|  | ||||
| TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") { | ||||
|     //TODO: | ||||
|     //  * substr | ||||
|     using Catch::StringRef; | ||||
|     SECTION("Simple constructors") { | ||||
|         constexpr StringRef empty{}; | ||||
| @@ -144,6 +142,7 @@ TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") { | ||||
|         STATIC_REQUIRE(stringref.begin() != stringref.end()); | ||||
|         STATIC_REQUIRE(stringref.substr(10, 0).empty()); | ||||
|         STATIC_REQUIRE(stringref.substr(2, 1).data() == abc + 2); | ||||
|         STATIC_REQUIRE(stringref[1] == 'b'); | ||||
|  | ||||
|  | ||||
|         constexpr StringRef shortened(abc, 2); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský