Type: Posts; User: JohnW@Wessex
Search took 0.09 seconds.
December 20th, 2013, 10:13 AM
I copy and pasted your code directly to a VS2013 project.
It compiles with no errors.
December 20th, 2013, 09:48 AM
You don't need to cast it to a std::string. It has an inplicit constructor for char*.
: result("Hello world")
December 20th, 2013, 09:26 AM
See the edited post.
"One option is to remove the std::string conversion operator and let the string be constructed from the char*."
December 20th, 2013, 09:15 AM
The problem is that a std::string can be created from both a std::string and a char*.
When the compiler sees the line 'c=b;' it cannot determine which conversion operator it should use.
December 2nd, 2013, 05:09 AM
You may find this post on Stackoverflow useful.
November 20th, 2013, 04:55 AM
Indeed, but I was trying to post the least amount of code that replicated the problem.
November 20th, 2013, 03:52 AM
I've been creating a custom container and ran into this problem that has had me flumoxed all day.
I'm sure I'm missing something obvious, but I just can't seem to see it.
The code below fails...
October 16th, 2013, 11:40 AM
I don't really know. I assume one of the include file got corrupted in some way.
A normal re-installation didn't seem to overwrite all of the files.
I uninstalled VS, manually erased the folders,...
October 16th, 2013, 10:11 AM
October 16th, 2013, 10:03 AM
Not that I'm aware of. I imagine something got corrupted, but I hoped a re-install would fix it.
I'm going to try to eradicate all traces of VS2008 from my PC and do another re-install.
October 16th, 2013, 08:47 AM
For some reason, my Visual Studio 2008 Express has started to throw compile errors when including <iostream>
All projects that previously compiled without errors are now failing.
In fact I can...
October 7th, 2013, 03:20 AM
I ended up using Superbonzo's technique.
October 6th, 2013, 05:40 AM
As I've just discovered, this technique does not compile if any of the template parameters have copy constructors.
On Visual Studio this gives error C2621
September 16th, 2013, 09:16 AM
I got the usual FUD aurguments from them such as 'code bloat', 'slow' and 'inefficient'.
I tried to point out that, if they were experienced C coders, they were undoubtedly manually implementing...
September 16th, 2013, 08:36 AM
Some of the information here should give you an idea.
September 13th, 2013, 10:26 AM
I tried talking up the suitability of C++ in an embedded environment to a group of hardware engineers (who'd never programmed in anything but C) at an interview once. It didn't go down too well.
September 11th, 2013, 09:57 AM
I haven't delved much into TMP yet (It tends to give me a headache quite quickly) but I'll squirrel that information away for future reference.
September 11th, 2013, 08:51 AM
I work with embedded projects and, unfortunately, the compilers aren't likely to have C++11 support for a while yet. :sick:
September 11th, 2013, 08:41 AM
Search the web for opinions about what parts of C++ to be aware of when programming in an embedded envioronment.
Opinions can differ quite a lot concerning C++ constructs, but RTTI, dynamic memory...
September 9th, 2013, 07:53 AM
Yes that would be simpler.
The technique I used was from a more generic solution for templates with variable numbers of type parameters.
September 9th, 2013, 03:13 AM
That's what I thought, but I just got a bit paranoid about missing some dark corner case.
September 6th, 2013, 10:29 AM
Can people just do a quick sanity check of this concept?
I'm playing around with a technique to parameterise a template with the largest 'sizeof'
result for a set of classes.
A, B, C & D are...
July 15th, 2013, 07:42 AM
Herb Sutter has written about exception specifications here.
His conclusions were...
Moral #1: Never write an exception specification.
Moral #2: Except possibly an empty one, but if I were...
You may find this useful.
March 19th, 2013, 05:31 AM
Also be aware that sometimes compilers will initialise variables when in 'debug mode' but leave them untouched when in 'release mode'.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.