Questions tagged [fundamentals-ts]

The C++ Technical Specification "Library Fundamentals"

C++ is standardized in an ISO International Standard (IS). In addition to the IS, ISO also publishes a series of Techinical Specifications (TS) on specific domains.

The Library Fundamentals TS contains additions and evolution of general-purpose, core library components (such as string_view, optional, any).

11 questions
187
votes
2 answers

What is string_view?

string_view was a proposed feature within the C++ Library Fundamentals TS(N3921) added to C++17 As far as i understand it is a type that represent some kind of string "concept" that is a view of any type of container that could store something…
Drax
  • 11,247
  • 5
  • 37
  • 77
13
votes
1 answer

string_view behaviour when passing temporary std::string

I just ran into some misunderstanding: at least in libc++ implementation std::experimental::string_view has the following concise implementation: template class basic_string_view { public: typedef _CharT…
Bikineev
  • 1,645
  • 14
  • 20
12
votes
1 answer

How could std::experimental::source_location be implemented?

C++ Extensions for Library Fundamentals, Version 2 (N4564) introduces the type std::experimental::source_location. § 14.1.2 [reflection.src_loc.creation] says: static constexpr source_location current() noexcept; Returns: When invoked by a…
5gon12eder
  • 21,864
  • 5
  • 40
  • 85
2
votes
1 answer

Detect operator++ signature with std::is_detected_exact

I want to detect at compile time if a given type has the pre-increment operator with the library fundamentals TS v2 type_traits' is_detected_exact helper - however, it seems like I either misunderstood this helper or I supplied the wrong parameters,…
Christian G
  • 843
  • 9
  • 16
1
vote
1 answer

Stuck with Matrix addition in python

Please look at my code for matrix addition in python and help me to resolve the issue. Code: def matrix_addition(a, b): # your code here res = [] for i in range(len(a)): for j in range(len(b)): sum = a[i][j] + b[i][j] …
0
votes
2 answers

C++ Rock Paper Scissors

I`m trying to make Rock Paper Scissors game in c++.I tested my code on codecademy.com And It worked Properly but when I execute it on codewars.com It gives me this error : main.cpp:29:1: warning: control may reach end of non-void function…
0
votes
2 answers

No operator "*" matches these operands

this is my code glm::vec3 v(4, -6, 7); glm::vec3 twiceV = 2 * v; I have included glm Stable and experimental glm extensions. Why I cannot use int * vec?
Morovo
  • 3
  • 3
-1
votes
0 answers

how i can find problem in selection sort scenario code in java

this one is given ion exercise : For consistency in which version of Selection Sort is implemented: Stop the sort once the unsorted area is only one element. Don't swap if the minimum element is the first element in the unsorted area (so no printout…
-1
votes
3 answers

C# form switch and vice versa

Assume that I have a C# Solution with 3 projects Main, Program1, Program2. I want to have a "Main form", when I click on button "Program1" the main form will be hidden, Program1 will be showed, and when I close Program1, the Main form will…
Luke
  • 1,126
  • 2
  • 18
  • 25
-2
votes
1 answer

Exes and Ohs (C++)

This is what I am asked to do:Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any char. Examples input/output: XO("ooxx") => true XO("xooxx") =>…
-4
votes
2 answers

Hi everyone. i would like to write a program which prompt the user to enter five numbers and check conditions

I would like to write a program that prompts the user to enter five numbers and check conditions. If a user enters any number that is not matched with the condition then the user should again get the prompt irrespective of the count (5) then append…
Darrhyl-K
  • 9
  • 2