Skip to content

How to overcome strictly weakly ordered for sets and maps #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MFaisalZaki opened this issue Aug 17, 2022 · 0 comments
Open

How to overcome strictly weakly ordered for sets and maps #59

MFaisalZaki opened this issue Aug 17, 2022 · 0 comments

Comments

@MFaisalZaki
Copy link

I have this code snippet

#include <iostream>
#include <string>
#include <set>
#include <map>

int main() {
    std::set<std::string> std_section_names;
	std_section_names.insert(".text");
	std_section_names.insert(".itext");
	
    // ---- 
	std::map<std::string, double> pe_attr = {
		{"instructionsCount", 0.0},
	};
    return 0;
}

Where I created a set of strings and a map with string to double in order to count frequency. However, the CTR57-CPP hits with this message

Comparator 'std::less<basic_string<char, char_traits<char>, allocator<char>>>' used on container or sorting algorithm that is not strictly weakly ordered 
```. 

I understand the issue very well, yet I don't know how to fix it properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants