Hello there...
Let's say i have some threads that want to give each other some non-zero values. Repeatedly in turns; that is, thread A gives thread B some non-zero value and then A responds with some non-zero value as well and this continues indefenitely. (but with more threads in chain). I use a variant of the static tree barrier for this purpose, but instead of a boolean sense value (where thread spin waiting for it to change), i...
User Profile
Collapse
-
A Question about C++11 relaxed atomics
-
gcc equivalent to icc's -debug inline_debug_info
Hi to everyone!
In icc (intel's c compiler) i can do : -g -debug inline_debug_in fo for line map information in the object code.
With gcc am i ok with only -g or do i need something more?
Thanks in advance for any response! -
See it as a general question about IDEs.. for example i make a simple main function where i use a std::vector<int > and maybe a std::list<std:: string>.. where can i see that the compiler has generated those instantiations (not necessary see their code but e.g. symbols for their names, functions instantiated etc)... the only reason that it might be helpful to me is to see "in action" all the instantiation rules and specializations... -
C++ see template instantiations
Hi!
Is there a way in either Visual Studio 2010 or g++ (any version) to see what classes it instantiates and their code? For example to see if i avoid code bloat when i explicitly instantiate a template for certain types.
Thanks! -
specialisation for templates that have template arguments
we have a class template that has a template argument and want to specialize it..
anyone has any examples for this? (haven't any particular case in mind just want to see how this is done to get it working)
e.g:
Code:template<bool> class BoolClass{}; template< template<bool> class C> struct dummy; template<> struct dummy< ... for BoolClass<true> >{};
-
Take address of non-member operator
hi
can i take the address of a non-member in C++ to use it e.g. in ptr_fun() ?
Code:ostream& operator<<(ostream& out, const X& x){ .... }
Code:list<X> xs; for_each(xs.begin(), xs.end(), bind1st(ptr_fun(what_here??),cout));
-
immutable object from mutable object
hi!
is there any way in java that i can create a immutable object from a mutable one? like the const in C/C++ and the Collections.unm odifiableXXX functionality from the Collections class. I know that this doesn't exist in java (as far as i know) but if anyone knew any trick (reflection, at byte level etc.. any weird stuff) to do that?????
thanks in advance :) -
C++ templates
hi..
i am learning C++ and i made a complex<T> class.
I made a copy constructor from complex<T2> to complex<T1>,
I have also made a:
template< class T > operator+(const complex<T>& a, const complex<T>& b)
if a write:
Code:complex<float> f; complex<double> d; f + d;
-
-
actuyally if there is only one statement {} are not necessary :)Leave a comment:
-
set of "differenet" enums
Hi!
in Effective Java (don't rememember item number) i read that
a enum set can be used to group together "flags" that are to be set somewhere, example:
Code:public class Text{ public enum Style{ BOLD, ITALIC, ... } public void applyStyles(Set<Style> styles) { ... } } ... and we apply the styles in user code as: ... text.applyStyles(EnumSet.of(Style.BOLD));
-
-
actually i thought that i answered back in this question..
i found the answer the other day in another thread in bytes... http://stackoverflow.com/questions/2...calling-stdmax
the reason is that min and max are usually defined as macros in other header files and the max must be put in parethneses [as in (std::max)] to prevent
macro substitution...Leave a comment:
-
std::max() vs (std::max)()
hi!
i was reading the Boost Library Requirements and Quidelines document and in encountered the following guideline (among similar others):
use (std::max)() and not std::max()
anyone knows why that?
thanks -
Effect of integer type in bitwise operations performance
hi!
when using the bitwise operations such as in:
Code:int a = ...; int b = ... ; a & b; a | b; ...
thanks! -
Collections new unmodifiable
Hi!
The methods from the Collections class that return a unmodifiable version of the passed Collection create a new class that have a copy of the passed parameters or a wrapper that delegate to the methods of the passed collection?
Thanks in advance -
IO data sources adapter
Hi a need a framework so that i can get input from various input sources (and get a object each time from it) and write objects to various output sources...
Anything in mind? -
How to code for different versions of frameworks/services/etc ....
Hi! Think that this is the right thread for this question...
Let's say that i write a client library for a server. The server of course gets updated and new versions of that server are released.
How to code the client library in order to do stuff such as:
1) If the client library is for version 2 but the
user connects to version 1 of the server using that
library, how to guard... -
Is this hashCode() thread-safe from String??
This is the hashCode() from the openjdk String class:
Code:public int hashCode() { int h = hash; if (h == 0) { int off = offset; char val[] = value; int len = count; for (int i = 0; i < len; i++) { h = 31*h + val[off++]; } hash = h; } return h;
No activity results to display
Show More
Leave a comment: