Questions tagged [std]

The C++ Standard Library, and its namespace. Use in conjunction with [c++].

From Wikipedia

The C++ Standard Library provides several generic containers, functions to utilise and manipulate these containers, function objects, generic strings and streams (including interactive and file I/O).

http://en.wikipedia.org/wiki/C++_Standard_Library

The concept of using namespaces

http://en.wikipedia.org/wiki/Namespace_(computer_science)

Also see

4970 questions
3
votes
1 answer

O(1) std or boost list concatenate

Is there a data structure, such as std::list, that allows O(1) concatenation of one list to the end of another? I.e. the final item in list A is linked to the first item of list B?
Chris Redford
  • 16,982
  • 21
  • 89
  • 109
3
votes
1 answer

expected unqualified-id before token... 'std::'

When i compile C++ code in an Android NDK project i get: expected unqualified-id before '(' token FPEnvironment_DUMMY.h /PocoFoundation/jni/include/Poco line 98 C/C++ Problem The error origins from the lines: inline bool…
David Karlsson
  • 9,396
  • 9
  • 58
  • 103
3
votes
2 answers

why and how does rand() exist both in global and std namespace in cstdlib?

I understand that rand(), as an example function from , exists both in the global and the std namespace. In effect the following will compile without errors, i.e. both calls to std::rand() and rand() will be legit. #include
gevang
  • 4,994
  • 25
  • 33
3
votes
1 answer

Visual Studio: Global namespace takes precedence over local

I got some code sent to me today, and it's using the std::transform on a std::string to make it all lowercase. The sender had written and compiled the code in Visual Studio 2010: using namespace std; string test = "TEST"; transform(test.begin(),…
hugolm84
  • 166
  • 1
  • 5
3
votes
1 answer

stoi and std::to_string on mingw 4.7.1

Well I wanted to port my C++11 programm to windows, but it seems in mingw 4.7.1 there is no stoi and std::to_string implemented. I know it has been asked and there was a solution to edit some header, but in my mingw version (4.7.1 shipped with…
user1873947
  • 1,781
  • 3
  • 27
  • 47
3
votes
2 answers

Does the value of std::endl depend on the OS?

Possible Duplicate: what does std::endl represent exactly on each platform? I'm trying to figure out if std::endl returns \r\n, \n, or \r depending on the platform, or if it sticks with one all the time.
Lakey
  • 1,948
  • 2
  • 17
  • 28
3
votes
1 answer

llinking @_Znam and @_Znwm

I'm new to c++ programming and currently working on an llvm front-end development project. When I link the object files created by llc, my linker cannot locate the following functions. I know that these are standard c++ library functions but using…
user1723583
  • 553
  • 1
  • 6
  • 18
3
votes
2 answers

is this boost::tuple code convertible to pure std:: standard library code?

Is the following boost code convertible to pure c++11 standard libraries? I see std::tuple and std::for_each but I can't seem to get them to play with each other. I am currently using gcc 4.7.2. CODE #include #include #include…
kfmfe04
  • 14,936
  • 14
  • 74
  • 140
3
votes
2 answers

has ::std::has_nothrow_default_constructor been moved/changed?

In trying to build boost mirror with gcc 4.7.2, I ran into this error, but oddly enough, I see this documentation. Has ::std::has_nothrow_default_constructor been moved/changed? In file included from…
kfmfe04
  • 14,936
  • 14
  • 74
  • 140
3
votes
3 answers

Accept only letters

This should accept only letters, but it is not yet correct: #include #include #include using namespace std; int main() { std::string line; double d; while (std::getline(std::cin, line)) { …
sg552
  • 1,521
  • 6
  • 32
  • 59
3
votes
3 answers

CDT Indexer cannot find std::unordered_map

My Eclipse CDT indexer apparently cannot find std::unordered_map, although the compiler does. It shows the following "errors": The "Includes" folder of my project looks like this: How can I tell the indexer how to find std::unordered_map?
clstaudt
  • 21,436
  • 45
  • 156
  • 239
3
votes
1 answer

How to read from std vector front and remove read variable?

How to read from std vector front and remove read variable? Is it: v.front(); v.erase(v.begin());
myWallJSON
  • 9,110
  • 22
  • 78
  • 149
3
votes
1 answer

using std::set find with struct data

typedef struct Edge { int v1, v2, w; bool operator <(const Edge &rhs) const{ bool b = v1 < rhs.v1 || v2 < rhs.v2; return (b); } } edge; template struct my_less { bool operator()(const T& _Left, const T&…
user1850593
  • 325
  • 1
  • 3
  • 7
3
votes
2 answers

What is the use of std::nothrow and std::new_handler in standard header file

I came across a small standard header file . I have probably not seen its direct use before. Here is the g++ version for those who are interested. Below part is of my interest: struct nothrow_t { }; extern const nothrow_t nothrow; /** If…
iammilind
  • 68,093
  • 33
  • 169
  • 336
3
votes
5 answers

Convert hex std::string to unsigned char

I have a hex string and want to convert this to a hex unsigned char array! std::string hex = "0c45a1bf" unsigned char hexCh = "" [0] = "0c" [1] = "45" [2] = "a1" [3] = "bf" I want this bevavior shown in hexCh! Best way over…
leon22
  • 5,280
  • 19
  • 62
  • 100
1 2 3
99
100