« first day (415 days earlier)      last day (4531 days later) » 

11:00 PM
> A declaration of a constructor for a class X is ill-formed if its first parameter is of type (optionally cv-qualified) X and either there are no other parameters or else all other parameters have default arguments. A member function template is never instantiated to produce such a constructor signature.
 
struct Base { template <U> Base(const U& rhs); }; and just specialize it in the .cpp file?
 
Time to sleep?
 
I'm practising stupid binary arithmetic on paper.
Test tomorrow. Sucks like hell.
 
Do you still count a linker error as catching it at the right time?
 
11:01 PM
Sounds like a basic Computer Architecture Course
 
Xeo
9
A: How to pass a shared_ptr to a mutable object as a parameter?

XeoAlways pass shared_ptrs by value. If you pass a reference, you might run into the problem that a call to a function of the object managed by the shared_ptr might just reset it, and now you've got a dangling pointer. If you pass by value, you ensure that the object will survive the current functio...

Sheesh
@rvalue Yes
 
Nevermind, still wouldn't catch it if the call site just had a Base&
 
@CatPlusPlus What course is it?
 
@Xeo I'm pretty sure the standard says that a copy constructor is one which takes the argument by reference...
 
@Xeo I pass shared_ptr by reference all the time, it's fine if you remember to only pass values that are in your own scope or passed by reference to you the same way.
 
11:06 PM
Computer Systems Organisation, or some crap like that.
 
Or rather, if you don't go around managing other people's objects.
 
shared_ptr by value FTW.
@KerrekSB Already quoted!
 
It's probably not best practice, but there was a measurable penalty from the copies we were doing.
(small cache architecture)
There's an item in the backlog to use intrusive_ptr instead, but I don't expect that to be fixed before release.
 
awe xeo isent here
 
Xeo
I am
 
11:10 PM
i was gonna show him some revised hashing code
ah
is this cleaner to your eyes?
CCryptProvider prov(CWinCryptAlgorithm::CWinCrypt_MD5);
CHashProvider Hasher(prov);

Hasher.HashData("this data is going to be hashed");

auto ret = Hasher.FinishHash();
 
on x64, there's just one calling convention, right?
 
Xeo
But sadly, I have no time atm, as I need to finish formulating my question before the daily rep cap resets in 50 mins
 
@DeadMG AFAIR, yes.
 
yes, just one calling convention
 
Xeo
@johnathon Very much so
 
11:12 PM
@KerrekSB I'm becoming more convinced that the only way to stop slicing statically is to only derive from abstract classes.
 
@Xeo get your question done man
 
@rvalue Stopping slicing statically is a non-solution, because slicing is a non-problem
 
@CatPlusPlus No, there's the Microsoft x64 convention on Windows and the AMD x64 ABI on $other_platform
 
Oh, look, another question on SO about slicing.
 
This article describes the calling conventions used on the x86 architecture. Calling conventions describe the interface of called code: * The order in which atomic (scalar) parameters, or individual parts of a complex parameter, are allocated * How parameters are passed (pushed on the stack, placed in registers, or a mix of both) * Which registers may be used by the callee without first being saved (i.e. pushed) * How the task of setting up for and restoring the stack after a function call is divided between the caller and the callee This is intimately related with the assignment of si...
 
11:15 PM
@rvalue @DeadMG is hardcore Windows user. :P
 
You'd have to be.
:P
 
I've recently reached the conclusion I'm using Windows mainly because of Steam.
 
What are you playing?
 
Dual booting is too much of a hassle, really.
 
@CatPlusPlus how about a single unifying desktop manager ? Not having to learn (or expect users to install libs from) another window manager to use your gui app?
 
11:17 PM
Just moved house, Steam locked me out of my single-player games for two days before I could get 'net because it knew there was an update that it hadn't installed before I moved the PC
 
@johnathon Meh.
 
Anyway, I should get some work done - have a good day, peeps.
 
@CatPlusPlus i know, there's tons of reasons not to use windows, but there's a few good reasons from a programmers perspective IMHO
 
Same goes for Linux.
But Windows has Steam, so I can procrastinate easier.
 
Goodnight lads.
 
11:19 PM
@ManofOneWay Lots of stuff. :P
 
@CatPlusPlus yup, hence why i dual boot myself.. actually tri boot.. but that's another story all together
 
Ever played Final Fantasy?
 
How does one mask of the top x bytes of an integer without knowing how big integers are?
preferably without using sizeof
I know how you'd do it with that
 
@ManofOneWay No.
 
shift it
 
11:20 PM
You should! Final Fantasy VII is the best game ever
 
By mask I mean obtain
 
I preferred VIII
 
sorry, used the wrong word
 
As well as Zelda: Ocarina of time
 
for instance, I want only the top 4 bytes of an integer
 
11:21 PM
Dead, what did you think of XII ?
 
I've tried to try FF7, but I couldn't get it work even on XP.
Besides, jRPG aren't very compelling in terms of gameplay.
And when mechanics completely suck balls, even a good story can't help.
 
@SethCarnegie int masked = raw & (~0xFF); // extend with FF for how many bytes you want to leave
 
@DeadMG X for me.
 
Well, the atmosphere in FF7 is really incredible, the story, the music
 
@rvalue that only works if I know the size of an integer
 
11:24 PM
@SethCarnegie You do, always. sizeof() gives it to you
 
so, for a 4-byte int you want the whole thing, and for an 8-byte one you want the top 4?
 
Xeo
Since @Pubby is already gone, anyone else here with GCC 4.7 willing to test two little code snippets?
 
If you don't know the size, you can't tell where's the top.
 
1. Zelda: Ocarina of Time
2. Final Fantasy VII
3. Metal Gear Solid
4. Resident Evil 2
 
@SethCarnegie what is your reason for not wishing to use sizeof() ?
 
11:24 PM
these are games you must play
 
@rvalue for 4 bytes I want top 4 bits, for 8 bytes I also only want top 4 bites
 
you're missing System Shock 2
 
@ManofOneWay beat them all
 
oh, bits
 
@ManofOneWay Same thing goes for 4, 6, 8, 9, and 10.
 
11:25 PM
I think I've even finished MGS.
 
@johnathon I don't want to use it if it can be avoided
If there was a magic way to do it I didn't know
without sizeof
 
@SethCarnegie it's considered a C++/C operator ...
 
@BenjaminLindley Agree =) It's a great series
 
@johnathon I know but it clutters up expressions to me
 
RE2 isn't my genre.
 
11:25 PM
make a function with int32_t and int64_t overloads
 
@SethCarnegie then typedef it
 
well, I'm not going to waste my life helping you
either use the tool the language gave you, or go cry in a corner
3
not going to spend my time supporting your subjective definition of clutter
 
@DeadMG LOL
 
@DeadMG I only wanted to know if there was a way to do it without sizeof
no need to go ballistic :)
 
@SethCarnegie Seth, there's a reason sizeof() exists. So typedef it if you dont like using it. It'll still be portable. And it'll work.
 
11:27 PM
@CatPlusPlus RE2 is not all about the scary parts, it's very much about the story and atmosphere, and pussle solving
 
alright alright
 
@SethCarnegie char topFour(int32_t x) { return x >> 28; } char topFour(int64_t x) { return x >> 64; }
 
@rvalue I know how to write it, but that's incorrect anyway
needed the top 3 bits not bytes
4*
 
@ManofOneWay I don't like horrors in any form. Or puzzles, really.
 
Xeo
0
Q: Is it possible trigger a compiler / linker error if a template has not been instantiated with a certain type?

XeoFollow-up question to [Does a casting to a pointer to a template instantiate that template?]. The question is just as the title says, with the rest of the question being my tries to achieve the goal. The goal in my tries: Trigger a linker error on the call to check_error<char>. // invo...

 
11:28 PM
What do you like then? =) Name your top 5 list!
 
sure
 
Xeo
Should be >> 61
 
@rvalue not quite :) it's still x >> 64
 
yeah
 
Xeo
Or 60?
 
11:30 PM
inline unsigned int top4bits(unsigned int n) { return n >> ((sizeof(n) * 8) - 3); }
 
Xeo
Whatever
 
Top 5, huh. I don't really rank stuff.
 
is that correct
 
Fallout.
Half-Life. TF2.
 
Xeo
@SethCarnegie Hey, and you just used sizeof! :D
 
11:31 PM
Worms.
 
@Xeo yes I know geez, I was just asking if it was possible without sizeof
obviously it isn't from all your replies
so I used it :)
 
@SethCarnegie Yes, with size-specific overloads for each size.
 
That's even worse
to me :)
 
Civilisation.
 
Xeo
Hm, I need 8 rep in 30 minutes for rep softcap
 
11:32 PM
You asked if it's possible. What you want is a size-dependant expression without reference to the size.
 
Xeo
and 23 for the hardcap
 
I don't know if it's strict top 5, really.
 
@rvalue actually I was looking for a non-size-dependent expression, in the way that x & 0xF is not size dependent
to get the lower 4 bits
but there doesn't seem to exist one
 
=)
All PC games!
you don't play any consoles?
 
11:33 PM
x & rotr(0xF, 4)
 
Never had any, don't want any.
 
You're too young, when I was a kid I played Nintendo 8-bit and enjoyed life
 
When I was kid I played DOOM. Screw consoles.
 
When I was a kid I played outside.
5
 
Did you build figures out of cones?
 
11:36 PM
Uh, no? Wait. What?
 
Out-what?
 
@ManofOneWay: oh, haha. Um... no.
 
I've never heard of that game.
 
@JohnDibling How would you say it in english? Making cone-figures? Or what?
 
11:38 PM
@ManofOneWay that is how it would be expressed in english
 
@ManofOneWay though one might want to proceed it with the adjective "pine"
 
I didn't know what you meant by "cones." I was imagining this: en.wikipedia.org/wiki/Coneheads
 
@ManofOneWay "pussle solving" sounds dirty
 
11:40 PM
Or that ^
 
This triples as a hat and sound enhancer.
 
@CatPlusPlus such cones are preceded with the adjective "traffic"
@CatPlusPlus indeed!
 
And the earlier cones are preceded with "pine". :P
 
@CatPlusPlus indeed, as i noted :P
 
Here ya go, true cone.
This also doubles as a hat, strangely enough.
 
11:42 PM
even better: template<typename T> inline unsigned int topnbits(T number, unsigned int x) { return n >> sizeof(T) * 8 - x; }
 
@CatPlusPlus if only the ancient Egyptians had discovered trigonometry
@CatPlusPlus and PI
 
I hate trigonometry.
 
@CatPlusPlus why ? it's easy !
 
Hatehatehate.
 
@CatPlusPlus so is trig. it's just trig looped a shit load :))
*calculus
 
11:44 PM
Coincidentally, I hate calculus also.
 
@keithlayne Yeah, solving puzzles sounds better I guess
 
@ManofOneWay I'd say I've solved a few of the other in my day
 
People, refer to specific messages, so I don't have to search for whatever you're referring to.
 
@CatPlusPlus lol , i figured you'd say that, all trig boils down to is an algebraic expression of the ratios of angles to their respective sides as a variable value that can be algebraically manipulated
 
Right, mathemagic.
 
11:46 PM
@CatPlusPlus incidently, you can get your pc to do that mathemagic too .. for you..
 
Not on bloody tests I can't.
 
Aaaanyhow
Time to sleep
and Cat should study
 
@CatPlusPlus never had a TI-85 did ya?
 
@johnathon Wouldn't help me if I did.
 
Good night
 
11:47 PM
@CatPlusPlus um... yes.. it would acutally.. you can write your own programs for it, consider it a mini mini mini mini computer
@ManofOneWay goodnight
 
I know what TI-85 is, thank you.
 
@CatPlusPlus ah.. then your not allowed to use them on tests?
 
Bingo.
 
@CatPlusPlus then ya. go study.
 
grumble grumble
 
11:49 PM
I used to bullseye womp rats with my TI-85 back home
 
@CatPlusPlus Do theay let you use sin/cos/ ect tables??
 
Usually, no.
 
@CatPlusPlus telling me they want you to memorize the whole damn chart?
@CatPlusPlus that's just insane. Anyway you look at it.
 
Xeo
Okay guys, I'm out, see ya tomorrow
 
@Xeo goodnight
 
11:50 PM
It's already tomorrow.
 
6:50 pm here
 
It's funny how tomorrow decays into today when it becomes tomorrow.
 
@CatPlusPlus simmilar to arrays decaying into pointers
 
Xeo
@CatPlusPlus Tomorrow is after I slept. If I'd stay awake forever I'd be frozen in time. :P
 
@Xeo Hah, I use the same time measurement system.
 
11:52 PM
@Xeo i've tried that. it doesn't work.
 
After few hard days and all-nighter I no longer know what day of the week it is.
 
Xeo
After two days of holidays I no longer know what day of the week it is.
 
@CatPlusPlus if it wasn't for the calendar on my phone i would myself have a hard time keeping track of the day
and that's on any given day.
 
I always know when it's Monday, because it sucks so much.
And I guess Wednesday, because it sucks even harder.
But that might be this semester thing.
 
@CatPlusPlus Out of curiosity, Whats your major course of study?
 
11:57 PM
feline studies
 
@keithlayne i didn't know chasing pu$$y was major course of study everywhere! i was under the delusion it was only @ my college:))
 
@johnathon pretty sure that's a global constant
 
CS, I guess.
 
@keithlayne yea. i've given up on the chase. i'd rather spend my time neatly wrapping up very messy windows C api calls that i use 1 time to do 1 thing to satisfy Xeo's desire to not see C code in this channel
 

« first day (415 days earlier)      last day (4531 days later) »