Type: Posts; User: Lindley
Search took 0.19 seconds.
October 17th, 2014, 12:03 AM
UUIDs would be great, except that I don't think there's an easy way to generate them at compile time......
Another approach is to declare a function-local type everywhere I want a static, and use...
October 14th, 2014, 11:42 AM
That's an interesting idea, but I'm not convinced it will work....if two files start with the same letter but have different second letters, then (assuming identical lines) you'd end up with the same...
October 14th, 2014, 02:04 AM
I'm looking for a way to generate a program-wide unique value to use as a template parameter. Generating a unique value within a translation unit is pretty easy with __LINE__, but that doesn't ensure...
June 27th, 2014, 09:04 PM
I have a bit of logic that needs to work in a variety of environments. In particular, though, it seems that the libstdc++ that shipped with gcc 4.4.3 has has_trivial_assign, while later versions...
June 27th, 2014, 03:16 PM
Oh, and the strange thing is that if I look up C2960, I get an unrelated error from VS6. There doesn't appear to be any documentation of this error message.
June 27th, 2014, 03:04 PM
I am trying to use extern templates in VS 2010.
In most cases, people use extern templates purely as an optimization, but in my case I actually need them for correctness; in the header, the type...
April 4th, 2014, 10:10 AM
Note that <string> and <cstring> are not the same.
<cstring> is C++'s name for the old C <string.h>. It contains functions to operate on char*-style strings, like strcat, strcpy, etc.
March 28th, 2014, 12:38 PM
Is there a way to detect whether or not a template type has a protected destructor?
I see there is std::is_destructible in C++11, but I can't tell if this will return true or false for the...
January 30th, 2014, 02:20 PM
I believe I've worked it out. I did need a helper class to do the majority of the logic and keep the extra type hidden from the main interface.
January 30th, 2014, 12:42 PM
I may have generalized my example code too much....in my case, the parameter pack is a list of values, not types. This is good in that it allows me to pass an additional type as the first argument,...
January 30th, 2014, 11:15 AM
Let's say I have a variadic base class with a pure-virtual function per type:
template <typename ... Types>
template <typename T, typename ... Types>
January 30th, 2014, 10:59 AM
Thanks, that's exactly what I needed!
January 28th, 2014, 05:43 PM
Here's an interesting question I encountered. This isn't critical, but it would be "cool" to know how to accomplish it....
Let's say I have a variadic type A and a non-variadic type B:
January 24th, 2014, 01:34 PM
I don't really like base_from_member much, although I can see how it could occasionally save the day. In this case, though, it's a matter of completely inverting the normal construction/destruction...
January 24th, 2014, 10:23 AM
I have an AbstractAgent base class that manages a background thread. The actual work done in the background thread is accomplished through a pure virtual function call.
Here's the problem: because...
January 15th, 2014, 03:59 PM
I suspect I need to add these to Derived:
After reviewing what I'm actually trying to do, though, I'm going to make Consumer a...
January 15th, 2014, 02:47 PM
Let's say I have a templated base class:
template <typename Input>
void consume(Input input)
// do something
January 9th, 2014, 10:16 AM
That's just what the rule is, I've never thought too hard about it.
I suppose one *could* argue that a namespace is merely a scope, and like all scopes it doesn't require a closing semicolon,...
January 3rd, 2014, 10:52 AM
the same thing that's going on here:
So what you're saying is that during overload resolution, exact matches are preferred over template matches, but template matches are preferred over base...
January 2nd, 2014, 06:35 PM
I'm trying to learn how to use variadic templates, and I decided a great example would be serializing a series of types into a stringstream:
// Send a fully constructed message.
December 19th, 2013, 01:25 PM
gcc will do what you need.
I suggest you learn about virtualization environments such as qemu. They can greatly simplify the process of experimenting with OS-level functionality without...
December 19th, 2013, 01:21 PM
Let's be careful not to confuse the issue. Even though that last example works, there is a semantic difference between a pointer and an array, and that example mixes their syntax. It should be...
December 19th, 2013, 01:14 PM
1) Unit testing. A given function should always behave the same way when called with the same arguments; this is the basis of unit testing. If that function relies on global state, then it may not...
December 12th, 2013, 02:33 PM
Perhaps the fact that I'm finding it difficult to decide which header(s) should include the version header indicates I need to split one of my repos because it has too many unrelated things in it....
December 12th, 2013, 10:15 AM
My first experience with gitflow taught me that it's a mistake to include completely orthogonal bits of software in a single repo, because bumping the release version reflects on the entire repo, not...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.