Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged stl

0 votes
555 views
1 answer
    I'm using the STL map data structure, and at the moment my code first invokes find(): if the key was ... Thanks in advance for any suggestion. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
843 views
1 answer
    This is basically what I want to do: bool special_compare(const string& s1, const string& s2) { // match with ... can I do something like this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
505 views
1 answer
    Does anyone know why std::queue, std::stack, and std::priority_queue don't provide a clear() member ... the container adaptors provide it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
474 views
1 answer
    Just now, I'm reading Josuttis' STL book. As far as I know -- c++ vector is a c-array that can be ... I wanna understand why, what can happen. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
586 views
1 answer
    I'm writing an own container class and have run into a problem I can't get my head around. Here's the bare- ... class. What am I doing wrong? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
487 views
1 answer
    This code compiled OK under VS2013: std::string Unicode::utf16_to_utf8(std::u16string ... id@?$codecvt@_SDU_Mbstatet@@@std@@2V0locale@2@A) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
436 views
1 answer
    I have data in the following format: 4:How do you do? 10:Happy birthday 1:Purple monkey dishwasher 200:The ... in this format using only STL? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
453 views
1 answer
    Please correct me if I am wrong. Thank you! insert and erase will relocate elements, but elements before ... it should invalidate iterators. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
370 views
1 answer
    I'm trying to use istringstream to split a simple string into a series of integers: #include <string> #include < ... twice? How to fix it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
669 views
1 answer
    Is there a good way in C++ to implement (or fake) a type for a generic vector of vectors? Ignore the ... be popular with most C++ programmers. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
379 views
1 answer
    I'm making a C++ wrapper for a piece of C code that returns a large array, and so I've tried to return ... GetMyDataFromC(&buf[0], buf.size()); See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
297 views
1 answer
    What are containers/adapters? I have basic knowledge of C++ and its sub-topics like (class/templates/ ... application of containers/adapters? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
414 views
1 answer
    When I try to compile the following code: #include <iostream> #include <set> #include <vector> using namespace std ... wrong? Thanks in advice. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
305 views
1 answer
    I see function objects used often together with STL algorithms. Did function objects came about because of these ... What is its benefits? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
488 views
1 answer
    Here http://www.cplusplus.com/reference/stl/set/ I read that std::set in C++ is "typically" ... /compiler may violate this convention? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
624 views
1 answer
    The following code says that passing the map as const into the operator[] method discards qualifiers: #include < ... int> >] discards qualifiers See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
575 views
1 answer
    The question's pretty self-explanatory really. I know vaguely about vectors in maths, but I don't really see the link to C++ vectors. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
382 views
1 answer
    As a general rule, I prefer using value rather than pointer semantics in C++ (ie using vector<Class> instead of ... do I have to use pointers? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
542 views
1 answer
    I'm trying to delete everything from a std::vector by using the following code vector.erase( vector.begin() ... just want to empty the container See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
906 views
1 answer
    If I code this std::map<int, char> example = { (1, 'a'), (2, 'b'), (3, 'c') }; then ... hope that this discussion has been helpful for others. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
586 views
1 answer
    Is there a way to iterate over the keys, not the pairs of a C++ map? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
777 views
1 answer
    I have the following erroneous code which I am trying to compile in VC2010, but I'm getting the error ... be overlooking? Thanks for reading! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
612 views
1 answer
    What are the general use cases for the C++ standard library containers? bitset deque list map multimap multiset ... better for a paired search. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
476 views
1 answer
    In my program I have a STL set. set<string> myStrings; To improve the efficiency of my code I changed ... use references as container elements? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
607 views
1 answer
    I've a question about the thread safety of std::set. As far as I know I can iterate over a set and add/ ... Is lack of thread safety the cause? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
704 views
1 answer
    I have a class representing a user called Nick and I want to use std::find_if on it, where I want to find if the userlist ... !(n1 == n2); }; }; See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
523 views
1 answer
    I have been using std::vector a lot, and recently I asked myself this question: "How is std::vector implemented? ... that I should be aware of? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
551 views
1 answer
    I have a class TContainer that is an aggregate of several stl collections pointers to TItems class. I need ... of the m_Items member variable. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...