Search:
Type: Posts; User: ar115
Search:
Search took 0.06 seconds.
-
we have a function f with gets a string as below
void f( std::string str )
{
// body
}
is it safe to call this function with a const char* varialbe like below
-
The binary file used in program is a temporary file that is used during the
runtime of program. it does not even exist after the end of execution.
So I think the problems with portability can be...
-
I have an unkown object which is guaranteed to contain only POD's as
its member data.
Do the template functions below work correctly for saving and retrieval of its data from
a binary file?
...
-
I have found a solution to it in the below page under
section "Implementing Timers Using Signals"
http://users.evtek.fi/~tk/rtp/signals-programming.html#catching
we can use alarm() function call...
-
April 26th, 2010, 01:39 PM
really need that, any tip is greatly appreciated
thanks!
-
April 25th, 2010, 10:57 PM
could anyone tell me what function should I use for unix/linux?
-
April 25th, 2010, 02:34 PM
Then what should i do for linux & windows cases?
-
April 25th, 2010, 01:37 PM
Hi,
when using std::cin >> x; for getting a variable from user
the program is halted until the user inputs something. but
i want to have a time out (e.g. 10 seconds) which after
that the program...
-
April 19th, 2010, 12:39 PM
Yes it compiles now!
Many thanks
I should go and learn some mpl!
-
April 19th, 2010, 10:17 AM
excellent! I did not know we can do such thing with a few boost::mpl code!
I added the int main() below to the code and wanted to compile it but i get errors
int main(){
Stype::type ts1 =...
-
April 18th, 2010, 11:07 PM
I think you are correct, map binary search is good, and I think it would be fastest if the series of
left/right comparisons become unrolled at compile time ( again metaprogram! )
in code it...
-
April 18th, 2010, 03:10 PM
Thanks I did not know about Boost.Assignment
1- since the number of types T1,T2,... is limited (i'm sure it would be less than 10)
the map search algorithm becomes a little inefficient compared...
-
April 18th, 2010, 01:49 PM
Hi, I have an enum in my program named Stype like below
enum Stype { T1, T2, T3 };
There is a template function compute which take two Stype as
template parameter
-
April 16th, 2010, 06:50 AM
but it also works without setting the value of N like this
int main(){
int N;
int x[N];
}
-
April 16th, 2010, 06:35 AM
Hi,
I am sure that the size of c style arrays must be known at compile tim
but the code below compiles. I am using g++ 4.2.4 and really confused!
int main(){
int N = 5;
int x[N];
x[2] = 3;...
-
April 6th, 2010, 07:30 AM
My code is unstable currently and I want just to disable some part of it without removing it
maybe i decide to include that part again
#ifdef is a good solution but I was wondering if there is any...
-
April 6th, 2010, 07:05 AM
Hi
I have a simple macro which I use when I want to disable part of my code
#define OBSOLETE_CODE(x)
But using this macro when you want to make many lines obsolete in not good
and looks...
-
April 5th, 2010, 03:43 AM
but the signatures of foo::write_binary and global write_binary are different
so the compiler must be able to choose correct function
but it erros
test.cpp: In member function ‘void...
-
April 5th, 2010, 02:49 AM
Hi,
when I want to compile the below i get an error like
no matching function for call to ...
from g++
#include <iostream>
#include <fstream>
#include <vector>
-
April 4th, 2010, 07:39 AM
Many Thanks! it is a good solution
But is there better ones?
I was wondering if we can use a nested class and delegate things to it. since we can
use partial specialization for classes, something...
-
April 4th, 2010, 06:27 AM
Regarding to my needs I am sure that the above interface is good for me.
And it is hard for me ( and maybe boring for you ) to tell why I need that
I need just that to work, is there any good...
-
April 4th, 2010, 03:02 AM
I have a class which currently contains N vectors of int
and M vectors of double like below;
template< int N, int M >
class VectorCollection {
std::vector<int> ivec[N];
std::vector<double>...
-
March 16th, 2010, 07:45 AM
-
March 16th, 2010, 12:41 AM
Hi,
Can anybody help me why this code does not compile (gcc 4.2.4)
what does the error "invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary...
-
January 8th, 2010, 12:57 AM
Hello all,
I want to overload operator() of a class with a template function like below
//---------------------------
class A {
public:
template< int type >
void
operator()() {
|
Click Here to Expand Forum to Full Width
|