15,902,635 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Joren Heit (Top 13 by date)
Joren Heit
15-Jul-14 16:02pm
View
Haha, wow... that's insane :P Nice one
Joren Heit
15-Jul-14 14:08pm
View
I'm aware that CINT started as a C interpreter (hence the name), and that over time more and more C++ features have been added. By now, it supports templates, classes, inheritance, and much of the stuff that makes C++ C++. The fact that the language has been simplified to some extent does not mean it's not possible.
I must say I'm not at all familiar with C++/CLI (not a fan of platform specific languages; yes I know about Mono but let's be honest...), but in what way would the bytecode to be interpreted by the CLR be different from assembly code interpreted by a virtual x86 machine?
Joren Heit
30-Jun-14 7:53am
View
Sure, always go with the non-portable solution.
Joren Heit
24-Jun-14 17:33pm
View
Non-portable! Why not use STL when you can? See my answer :-)
Joren Heit
22-Jun-14 11:49am
View
Sidenote: when applying inheritance to
struct
s, the default is
public
. Of course you can derive a struct from a class and vice versa, in which case the default depends on the type inherited from.
Joren Heit
22-Jun-14 11:22am
View
Can't you just run your program from the commandline instead of double-clicking the executable? This is how it works on linux...
Joren Heit
17-Jun-14 9:24am
View
I thought it was clear that I'm aware of my comment being off-topic (that's why it's a comment). Just a tip to help you improve on your C++ vocabulary, take it or leave it! ;-)
Joren Heit
16-Jun-14 13:36pm
View
Of course, but I tend to avoid auto outside complicated templates and/or very long nested types like iterators.
Point
is short enough to be written out explicitly :-)
Joren Heit
16-Jun-14 8:45am
View
Completely off-topic, but still useful for you I hope. In C++, you don't need to declare access rights on every variable/function (unlike C#/Java). A class can have multiple private/public/protected regions, delimited by e.g.
public:
. Everything following this line will be publicly accessible. Furthermore, the members of a
class
are public by default, whereas the members of a
struct
are private by default. Therefore, if all your members are public anyway, you might as well put them in a
struct
(good habit arguments put aside).
Joren Heit
11-Jun-14 17:06pm
View
+5, better solution than specializing the entire class! Was just about to post something similar myself, when I saw this.
Joren Heit
11-Jun-14 16:59pm
View
Funny you should say that! I always found that reading right to left clarifies matters in C++ as well. For example:
int const *ptr
is a pointer to a constant integer, whereas
int *const ptr
is a constant pointer to an int. This is why I always tell people to write const to the right of the thing that's constant. So no
const int *ptr
, even though it's perfectly valid and seen a lot...
Joren Heit
10-Jun-14 10:20am
View
On a sidenote, there's no point in having
bool const
as a return type. Or any return by
const
value for that matter.
Joren Heit
10-Jun-14 9:53am
View
Of course this will work, but why do you need a cast? Why not just have a function with a descriptive name that returns pointer (or even better, a reference) to the members you need?
EDIT: I posted an alternative solution below.
Show More