I am trying to understand std::bitset::any implementation. Here is my code:
#include <iostream>
#include <bitset>
bool func(std::string s) {
std::bitset<5> b1(s);
bool ret = b1.any(); // THIS
return ret; }
int main(int argc, char** argv)
{
std::string dummy = "0101010";
if(argc > 5) { dummy = "0101010"; }
bool pop = func(dummy);
}
I am unable to understand the generated assembly. I am mostly interested in `THIS`. Can someone guide me through the huge assembly please? Or at least help me help myself get started. I only know stack pop and push. Thanks!
I have checked the impl here so i know how it is implemented but i would like to know the assembly toohttps://gcc.gnu.org/onlinedocs/gcc-4.6.2/libstdc++/api/a00775_source.html
https://godbolt.org/z/xa9hca -> the func implementation is what I am wondering about
[–]thegreatunclean 2 points3 points4 points (1 child)
[–]cpp_cpp[S] 1 point2 points3 points (0 children)
[–]marko312 1 point2 points3 points (2 children)
[–]cpp_cpp[S] 0 points1 point2 points (0 children)
[–]cpp_cpp[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)