Okay, thanks for your answer. So compilation may not go that much faster with pragma once because many compilers have intelligent detection of header inclusion guards? That kind of makes sense, since...
Type: Posts; User: TriKri
Okay, thanks for your answer. So compilation may not go that much faster with pragma once because many compilers have intelligent detection of header inclusion guards? That kind of makes sense, since...
Yes, I know, I use ordinary inclusion guards too but I still want to use pragma once if it is supported. They do so here in the boost bind library. However, they only use pragma once when the...
Hi, is there any way to check if
#pragma once
is supported by the compiler, during compile time?
If it is supported I want to call it since it may speed up the compilation, but if it's not...
Thanks! That seems like it will do it. Well, I guess it is easy to find it if you know what to look for. I actually made searches at both google and msdn, but I didn't manage to find anything I...
Hi! Is there any way to put the computer to sleep (or hibernate or power off also for that matter) from within a program, with the same result as pressing the sleep (or hibernate or shut down) button...
Well, yeah, but various kinds of mathematical expressions. It depends on how much I want to put into it. I'm not making the library because I think that it will be used, but rather because I want to...
I see what you mean now with using generic programming, together with boost::variant; I have thought about and I think it sounds like a good idea. However, the purpose of the library was not to have...
No, that's for sure! :D Glad we're okay.
I felt the conversation had kind of taken a wrong turn; you seemed to question the very way I wanted to use the library in. I don't question either your or CornedBee's skills; I believe you both are...
I have explained my thoughts and I will not develop them anymore; so I'm gonna drop the conversation here. I know what I do, and if you don't believe in it that's up to you. I have already been...
You suggest that I should use boost::variant, but isn't that to runtime-polymorphic, or has to decide in runtime what type it is?
I need to have all these types and the type switching since I...
CrnedBee: I'm not really sure if I understand everything you wrote; for example, do you mean C++ templates when you refer to concepts, and C++ classes when you refer to interfaces?
Then either...
I meant that I was going to use static_cast. Thank you. :)
I read the Wikipedia article about multiple dispatch; it mentioned the use of visitor patterns, which actually has crossed my mind before. However, I think that the code easily would get messy if I...
Elysia: I still don't see the drawbacks with using OOP. Wouldn't the methods that are common to all graphs be implemented in the base class, while the methods that differ among the different graphs...
I'm not really sure what you mean, do you have an example? Can't object-oriented programming be generic? According to Wikipedia, generic programming in C++ seems to be when you make use of templates,...
Hm, that's actually pretty smart. It would make each object 4 bytes bigger, but then since the type of the object would be known thanks to the variable, I won't need to have any v-table and the...
Because I can use a virtual function to do the job, which I believe is faster. But I don't know. Using a map was not a bad idea, though.
I can give you an example of what I mean:
A...
Hi! Is it possible to have virtual variables in a class (they would be stored in the v-table)? Or virtual constants? I know that I could just have a virtual function that returned the variable, but...
I'm actually making it more for learning purpose. But who knows, maybe it can become useful. :) However, the problem I introduced is one of the more difficult ones, which I don't know how to solve in...
Hi, I've planned to create a math library, containing a lot of different classes, basically starting with the most basic classes as natural numbers or positive integers, then negative integers, and...
What is the practical difference between declaring text_base as an array and declaring it as a char*?
That's it! Thanks!
Hi. Is there any way to get the length of a constant string at compile time, by following ISO C? I have this test code:
#include <string.h>
int main()
{
const char *text_base = "text...
I already have error reporting; sometimes I get timeouts from the attempts to open the port. It is the freezing of the program I want to prevent though. It's not a necessity, but it makes it feel...