+ 1

what is this hardware concurrency as 1

what's the difference between thread::hardware_concurrency; and thread::hardware_concurrency(); https://www.sololearn.com/compiler-playground/cFRyaBDsHOKh/#cpp https://code.sololearn.com/cFRyaBDsHOKh/?ref=app

25th Dec 2022, 6:48 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 Answers
+ 1
As I understand, the first form is just the address of the function, and usefull only when one is planning of using function pointers. So the value 1 is meaningless. The second form is the static member function of std::thread, which: "Returns the number of concurrent threads supported by the implementation. The value should be considered only a hint."
26th Dec 2022, 2:44 PM
Timo Vilen
Timo Vilen - avatar
+ 1
I understand that function name is considered a function address or function pointer and it does not require & sign before name But i have used it as auto. So, shouldn't it print address rather than 1? How that 1 is possible as adress ? Not only on sololearn, same 1 is obsereved on visual studio 2019 as well
26th Dec 2022, 5:19 PM
Ketan Lalcheta
Ketan Lalcheta - avatar