Partial specialization of function templates
Does anyone know if in upcoming C++ standard function templates can be partially specialized? Thanks. ...
Does anyone know if in upcoming C++ standard function templates can be partially specialized? Thanks. ...
I my current team we organize the dependencies to external libraries headers in the project settings like that: Compiler Settings->Additional Includes: d:\src\lib\boost_1_43 d:\src\lib\CxImage_6_00 ... As you can see, we include the exact library version number in our paths. The advantage of this method is that we always know, which e...
As I unserstand I should use QTcpSocket class in order to send a mail, and QTcpServer class in order to listen the connection and get the mail. But as I am a begginer in this area I need an example that demonstrates a simple transaction. Please give an example. ...
I have dependent and independent classes, I need to create database connections in these classes. As I understand from Qt documentation, if I create connections in default way, all of them use same connection. Should I create different database connections for different classes, or should I use same database connection. What are pros an...
Hi, all In my previous question you told me I should overload < operator. I tried it and now have another problem with it. I wrote this simple code in my vector.h file: int Vector3D::operator < (const Vector 3D &vector) { if(x<vector.x) return 1; else return 0; } and the last line of this part of my program calls this functi...
I have got several projects in my workspace. I have a script which set a different environment for each project. How can i get Eclipse CDT to use this script to set up the environment instead of setting everything by hand for each project? Thanks. ...
It's been a long time since I worked with C++, but I have a class that uses 3-dimensional data and I can't figure out how I can make this work. I need the sizes of the dimensions to be defined in the constructor. I tried this in the header: class CImage { public: float values[][][]; ... } and this in the constructor: CImage::CIma...
Hi, I'm not c++ programmer so I have problem. Simple problem, I think. I need play movie, can be only e.g. .avi (I can convert). Static width, static height, no button, no loop. I will write in PHP something like exec('window.exe movie23.avi'); And appears window, play video, window close. I rely code or good links. Best regards ...
After reading this thread http://stackoverflow.com/questions/121162/what-does-the-explicit-keyword-in-c-mean I made up this program class MyClass { public: explicit MyClass(int a) { cout<<"Int was called"<<endl; val = a; } MyClass(char *a) { cout<<"Char was called"<<endl; val = atoi(a); } MyClass(const...
I've just been bitten by a nasty undefined behavior due the returning a reference to a local variable. We know it's evil, and generally the compiler prints a nice warning to tell us so... well gcc (3.4.2) does not seem to push the checks too far though. std::string get_env_value(std::string const& key); std::string const& get_phase() ...
I'd like to copy and call a function, but the code below segfaults when calling the buffer. What do I have to change? (Linux, x86) #include <string.h> #include <malloc.h> #include <stdio.h> int foo () { return 12; } void foo_end () {} int main () { int s = (unsigned long long) foo_end - (unsigned long long) foo; int (*f) () = (int...
I initialize a string as follows: std::string myString = "'The quick brown fox jumps over the lazy dog' is an English-language pangram (a phrase that contains all of the letters of the alphabet)"; and the myString ends up being cut off like this: 'The quick brown fox jumps over the lazy dog' is an English-language pangram (a p...
In the Call Stack window of visual studio, it reports: [Frames below may be incorrect and/or missing, no symbols loaded for IPCamera.ax] What does it mean by Frames, and why missing symbols may cause it incorrect?AFAIK,symbols are just for debugging info,missing symbols will only make the source invisible . ...
Hello! I've just played with qjson library and got "underfinded reference" error. This is a code: #include <qjson/qobjecthelper.h> #include <qjson/serializer.h> class Person: public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(Gender gender READ gender WRITE setGender) Q_ENUMS(Gender...
Hi I have the following code: #define INPUT_FILE "-i" int main(int argc, char* argv[]) { .... } is there any way in C++ to compare between strings in argv[] and INPUT_FILE? I tried strcmp(argv[1],INPUT_FILE) It compiles but return false each time. Thanks ! ...
I have a program that I link with many libraries. I run my application on profiler and found out that most of the time is spent in "waiting" state after some network requests. Those requests are effect of my code calling sleeping_function() from external library. I call this function in a loop which executes many, many times so all waiti...
When debugging in Visual Studio, if symbols for a call stack are missing, for example: 00 > HelloWorld.exe!my_function(int y=42) Line 291 01 dynlib2.dll!10011435() [Frames below may be incorrect and/or missing, no symbols loaded for dynlib2.dll] 02 dynlib2.dll!10011497() 03 HelloWorld.exe!wmain(int __formal=1, int __formal...
Hello, I've got a small bit of code from a library that does this: #define VMMLIB_ALIGN( var ) var template< size_t M, typename T = float > class vector { ... private: // storage VMMLIB_ALIGN( T array[ M ] ); }; And you can call it by doing //(vector<float> myVector) myVector.array; No parenthesis or anything. what? Afte...
I have the following code: int main() { // Variables char name; // Take the users name as input cout << "Please enter you name..." << endl; cin >> name; // Write "Hello, world!" and await user response cout << "Hello, " << name << "!" << endl; cout << "Please press [ENTER] to continue..."; cin.get(); return 0; } After the user hi...
I am want to write a C++ program to accomplish drum stick matching. I am really new to C++, so could any one help me. Below is my project description Use the vector class in STL. Use iterators in STL. Use at least one STL algorithm Use an externally imposed design for an existing class without making modifications Create stubs to ...