background preloader

C++

Facebook Twitter

Luke Stackwalker home page.

Databases

Mixed (Native and Managed) Assemblies. Mixed assemblies are capable of containing both unmanaged machine instructions and MSIL instructions. This allows them to call and be called by .NET components, while retaining compatibility with components that are entirely unmanaged. Using mixed assemblies, developers can author applications using a mixture of managed and unmanaged functionality. This makes mixed assemblies ideal for migrating existing Visual C++ applications to the .NET Platform.

For example, an existing application consisting entirely of unmanaged functions can be brought to the .NET platform by recompiling just one module with the /clr compiler switch. Visual C++ supports the generation of three distinct types of managed assemblies: mixed, pure, and verifiable. Substitution failure is not an error. Specifically, when creating a candidate set for overload resolution, some (or all) candidates of that set may be the result of instantiated templates with (potentially deduced) template arguments substituted for the corresponding template parameters.

If an error occurs during the substitution of a set of arguments for any given template, the compiler removes the potential overload from the candidate set instead of stopping with a compilation error, provided the substitution error is one the C++ standard grants such treatment.[2] If one or more candidates remain and overload resolution succeeds, the invocation is well-formed.

Example[edit] The following example illustrates a basic instance of SFINAE: Here, attempting to use a non-class type in a qualified name (T::foo) results in a deduction failure for f<int> because int has no nested type named foo, but the program is well-formed because a valid function remains in the set of candidate functions. References[edit] About.

Visual

DW-Good Posts. SFML - Simple and Fast Multimedia Library. C++ calling a dll. Qt. 13.5 — Stream states and input validation. Stream states The ios_base class contains several state flags that are used to signal various conditions that may occur when using streams: Although these flags live in ios_base, because ios is derived from ios_base and ios takes less typing than ios_base, they are generally accessed through ios (eg. as std::ios::failbit). ios_base also provides a number of member functions in order to conveniently access these states: The most commonly dealt with bit is the failbit, which is set when the user enters invalid input. Note that this program is expecting the user to enter an integer. If an error occurs and a stream is set to anything other than goodbit, further stream operations on that stream will be ignored. Input validation Input validation is the process of checking whether the user input meets some set of criteria.

With string validation, we accept all user input as a string, and then accept or reject that string depending on whether it is formatted appropriately. String validation. Substring search algorithm. Using libcurl from C++ | Luckyspin.org. C++ curl wrapper. I am spending some time writing a little app to index all of my books. As I am getting the data from amazon I needed a little curl wrapper for C++. As the libcurl or curl man page and the online resources take some time to look through here it is.You just give it a URL and the class will return a string with the content of the URL or NULL if a error accrued.

This can be saved into a file. For example to download a image. Don't forget to add LDFLAGS=`curl-config --libs` in your Makefile The .h file And the .cpp File. The Boost C++ Libraries. 2.1 — Basic addressing and variable declaration. Addressing memory This lesson builds directly on the material in the section “A first look at variables“. In the previous lesson on variables, we talked about the fact that variables are names for a piece of memory that can be used to store information. To recap briefly, computers have random access memory (RAM) that is available for program to use. When a variable is declared, a piece of that memory is set aside for that variable. The smallest unit of memory is a binary digit (bit), which can hold a value of 0 or 1. The following picture shows some sequential memory addresses, along with the corresponding byte of data: Because all data on a computer is just a sequence of bits, we use a data type to tell us how to interpret the contents of memory in some meaningful way.

When you assign a value to a data type, the computer takes care of the details of encoding your value into the appropriate sequence of bits for that data type. Declaring a variable It’s that simple. OmniCppComplete - C/C++ omni-completion with ctags database. C++ - sum of elements in a `std::vector` C++0x Support in GCC.

C++0x was the working name of the ISO C++ 2011 standard, which introduced a host of new features into the standard C++ language and library. This project sought to implement new C++11 features in GCC, and made it the first compiler to bring feature-complete C++11 to C++ programmers. C++11 features are available as part of the "mainline" GCC compiler in the trunk of GCC's Subversion repository and in GCC 4.3 and later. To enable C++0x support, add the command-line parameter -std=c++0x to your g++ command line. Or, to enable GNU extensions in addition to C++0x extensions, add -std=gnu++0x to your g++ command line.

GCC 4.7 and later support -std=c++11 and -std=gnu++11 as well. Important: GCC's support for C++11 is still experimental. C++11 Language Features The following table lists new language features that have been accepted into the C++11 standard. For information about C++11 support in a specific version of GCC, please see: C++11 Library Features Historical Branches C++0x Concepts Branch.