Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Jan 2001
Offline Last Active Apr 09 2014 07:46 AM

Topics I've Started

Question about dereferencing syntax in C/C++...

13 August 2013 - 04:31 PM

I have always accepted how C/C++ dreferences structs and pointers to structs until a recent thread on a new language, C-UP. The developer stated that the language doesn't use the '->' operator to dereference pointers.

This makes a lot of sense. I'm curious why the C++ standard still requires the use of '->' and '*'?
struct foo{
int i;
int *j;
foo foo1,*foo2;
int temp;

// These next lines do the exact same thing...
foo1.i = 1;
foo2->i = 1;
temp = foo1.i;
temp = foo2->i;
temp = *foo1.j;
temp = *foo2->j;
The only reason I can see for the disparity is that '->' and '*' informs the reader that a pointer is being dereferenced. Does it truly matter? All that is being done is accessing a member of a class or struct.

List of C++11 compliant compilers?

01 August 2013 - 10:33 AM

I'm getting fed up with Visual Studio Express 2012. There are so many new language features that I can only look at in code samples.


Are there any *free* Windows-based C++11 compilers? What are some recommendations?

Question about an example of The Rule of Two.

28 July 2013 - 08:31 AM

L. Spiro posted this in another thread: http://www.artima.com/cppsource/bigtwo3.html

I find the concept fascinating, but I have a some questions about two of the RAII class member functions.

1.) What does the reset function do? What I see happening is it deleting the member pointer and then assigning the pointer passed into the function to the deleted pointer. How does that work? Is that legal C++?

2.) What purpose is there for the swap function? Apart from sorting pointers, is there any other reason for its existence?

How to tell if a context has been created?

08 July 2013 - 10:06 PM

I'm working on an OpenGL-based library that does not do context creation. I need a way for the library to test that an OpenGL context has been created, so that it can exit gracefully if not.


How do I do this?

Are there any text libraries that rely on GL 3.3 (or higher) core context?

29 June 2013 - 04:17 PM

I restricting myself to the core context for a project and I need some simple text rendering for stats. ALL of the text libraries that I have found use glVertex calls, even the ones that claim to be based on GL 3.3 or higher. I have yet to see a single library of code sample that uses VBOs and the programmable pipeline.


Does such a beast exist? This is something that I would really like to not have to write myself, if possible.


And please don't say FreeType. FreeType is not a rendering library and is not based on, nor does it use, OpenGL. I am familiar with FreeType. It doesn't do what I want.