« first day (749 days earlier)      last day (4191 days later) » 

user142019
5:03 PM
Man.
 
user142019
I got a new jacket today.
 
Woot. NFC seems working.
 
Normalization... from C?
 
Normal Form C, which Composed.
 
5:09 PM
Is that in reference to taking a regular array of bytes that C generates and putting it into codepoints?
Uh.
.... I'll just look it up, lol.
... NOPE nevermind confused as shit.
Just gonna forget about it.
 
Next I'll work on words, sentences, and lines, and then spend a long time getting efficiency improvements. This thing is really, really wasteful.
 
lol
oh, fuckshittyfucknuggets
can't derive my exceptions from std::exception because.. no Unicode support.
another thing to add...
 
How can I set a signed integer to all 0xffff...?
 
You can't?
 
@StackedCrooked x = 0; x |= 0xFFFFFFFF;?
 
5:15 PM
Just wondering what is idiomatic.
 
Isn't 0xFF... always -1 ?
 
@StackedCrooked With signed integers, nothing is.
 
@DeadMG You can overload operator,() for that.
 
int n = static_cast<int>(static_cast<unsigned>(-1)); // kinda clumsy
 
@StackedCrooked What do you want to do?
 
5:16 PM
@R.MartinhoFernandes Well, then just the shortest syntax that is always correct :p
 
If you want to have a bitmask, the correct type is unsigned.
 
@DeadMG Can't you just assume what() returns a UTF8 string whenever you deal with it?
 
@StackedCrooked None is always correct.
 
@ThePhD No.
 
Or maybe numeric_limits?
 
5:17 PM
Oh. Well then, I'm not sure what you can do. I guess you'll have to learn how to throw your own exception thingies?
 
@R.MartinhoFernandes I have a long n that I need to set to 0xFFFFFFFFFFFFFFFF as a magic value.
But actually now I realized that type is unsigned long to begin with...
 
@StackedCrooked But that's not a value that fits in long.
Pick a magic value that fits in it.
 
just make an unsigned long n, set it to 0xFFFFFFFF, then memcpy it over.
 
@StackedCrooked Ah, ok.
 
@StackedCrooked en.cppreference.com/w/c/types/limits See if numeric_limits::max does what you need.
 
5:18 PM
The thing is, if you want to set a long to value, just set it.
If you want a bitmask, use an unsigned type.
 
hmmm
what subnamespace to put a new exception class in?
 
Throwing ?
Exceptions ?
 
@ThePhD not a chance
 
While you're at it, can you make the standard exceptions use virtual inheritance? ;)
 
Personally, because I like the lulz,
 
5:20 PM
On the one hand I'm working with return values of ptrace(..) which returns long int and there is the user_regs_struct which contains all unsigned long int. So occasionally may need to convert.
 
@DeadMG That was harsh.
 
Also not very likely.
 
namespace Engine { namespace Tantrum {
class Tantrum { / * ... * / }
}}
 
@R.MartinhoFernandes It's a reference.
 
... In fact.
 
5:21 PM
@DeadMG lvalue or rvalue?
 
Goes to make a namespace Tantrum
 
in the vomit namespace
 
that reminds me
I need to submit a totally separate proposal for std::thunk.
 
I think for my string class, I'll keep Length() and such always working in code units,
 
@ThePhD code points
 
5:22 PM
but when I want to get non-codeunit stuff, I'll prefix all my functions with Language
 
Why don't you just name the subnamespace except?
 
I don't want the base to work in code points, though. I want it to work in code units - by the bytes, the short, the int - and then have explicit functions / iterators for looping over things by the codepoint (always a charcodepoint, which is typedef'd as a uint32)
 
character != codepoint, buddy.
 
Why did Microsoft mess up C++ in Windows 8?
 
5:26 PM
Eh?
 
user406009
C++ still seems to be working on my computer ...
 
What's with this business? msock->MessageReceived += ref new TypedEventHandler<DatagramSocket^,DatagramSocketMessageReceivedEventArgs^>([=](DatagramSocket^ msock, DatagramSocketMessageReceivedEventArgs^ args) {

		});
 
That's C++/CX.
 
Looks like C++/CLI to me with that ref.
 
Exactly. Why add the CX????
 
5:27 PM
isn't it supposed to be gcnew?
 
No.
It's C++/CX not C++/CLI
Windows 8 stuff
 
Oh.
 
Did that get depreciated or is it no longer used in C++/CX?
 
They use ref new instead.
Because they switched to reference counting using COM.
 
Ah I see. So no garbage collection involved eh
 
5:29 PM
That's what they'd want you to think.
But that same exact syntax can be used to construct a .NET class in Windows 8 as well
It could be BOTH reference counted AND garbage collected.
Depends which language they wrote the component in and what runtime it's using.
 
Reference counting is GC.
 
Guess I should be more specific and say .NET GC.
 
Also holy shit DatagramSocketMessageReceivedEventArgs it's so terrible
 
@IDWMaster except that they're different languages. You either compile your code as C++/CX or as C++/CLI (or as C++)
 
Verbosity overload.
 
5:33 PM
ref new exists in both C++/CX and C++/CLI, but with different meanings
 
the only operations available on a function pointer rvalue are call and de-reference, right?
 
@DeadMG assignment?
 
@jalf not on rvalue.
trying to decide if implicit conversion to function pointer is bad
 
ah right, didn't see the 'rvalue' part
 
@jalf I edited it in right after I posted
 
5:37 PM
@DeadMG I did something like that recently, felt really really dirty (but it did the job and I couldn't think of a better solution)
 
hmmm
 
WinRT doesn't seem like it was designed for C++.
 
except for rendering the IDE's autocomplete completely useless, since it doesn't know which arguments to highlight for a call
@IDWMaster how so?
 
@jalf All these ref news and ^s and stuff remind me of interoping C++ and C#/.NET code.
And the odd way they do ëvents.
 
@IDWMaster well, they are for interoping, just not with .NET, but the syntax was reused because it's intended to solve a very similar problem (interop with another language/platform)
events definitely seem like an oddity that's awkward to map to C++, and if it had been designed for C++, there probably wouldn't have been events (or maybe there would, you never know with Microsoft)
on the other hand, the WinRT collections and such are designed to map well to STL containers, rather than the crippled .NET ones.
so compromises abound, sure, but C++ was definitely one of the things they tried to cater to
it just wasn't the only language they had to map to
 
5:42 PM
And what's with the IBuffer thingy where there's no way to get the contents of the buffer directly?
Except in C#.
 
dunno, haven't looked at it :)
what's with it?
 
It's what every IRandomAccessStream uses for I/O operations
 
Is it related to the old COM interface IStream? Because that was just horrible
 
No.
You need it to do any kind of I/O on Windows 8
It's horrible
 
I guess I should actually play around with WinRT a bit one of these days
 
5:45 PM
There's a lot of things like that that you can only do in C# and not C++.
 
@IDWMaster I don't see anything extra for C#.
 
yeah, where's the C#-only stuff?
 
@R.MartinhoFernandes add using System.Runtime.InteropServices.WindowsRuntime;
using System.Runtime.InteropServices.WindowsRuntime;
That's the C# only stuff
 
@IDWMaster Every implementation of IBuffer must also implement IBufferByteAccess, which can be used to examine the contents of the buffer. IBufferByteAccess::Buffer returns a pointer to the underlying data. This Buffer member can't be a member of IBuffer because it returns a pointer and there are no pointers in the WinRT type system.
 
You'll see some VERY NICE extension methods there
@JamesMcNellis But how do you get a IBufferByteAccess from an IBuffer?
In C++?
 
5:48 PM
OOh, James is here. He's the local C++/CX expert.
 
@IDWMaster From C++, you'd use QueryInterface, just like with any other COM or WinRT interface. From C++/CX, I'm actually not sure.
 
@JamesMcNellis There's the problem. You have a WinRT type and you need to get it into COM.
But there's NO WAY to do the interop in C++ without going into managed code.
 
Maybe it's just that I'm new to the API, but the reference docs I've seen so far really seem to suffer from the "only useful to the people who wrote it" syndrome
 
dat cat!
 
@jalf The documentation is abysmal.
 
5:51 PM
What's the point of an IBufferByteAccess if you can't do anything with it?
 
Sometimes, I imagine Tony - being a Lion - as Cat's older brother or something.
It makes for an interesting relationship in my head.
 
@IDWMaster All WinRT interfaces are also COM interfaces. Not all COM interfaces are WinRT interfaces. (WinRT interfaces derive from IInspectable, which derived from IUnknown.)
 
I think at one point it involves death combat on a roof, with rain and dramatic slow-motion pans.
 
@IDWMaster You can get the buffer directly via IBufferByteAccess.
 
@JamesMcNellis So how do you convert a WinRT type to a COM type?
 
5:54 PM
oh crap, I really need to be better at actually using a calendar
so apparently I'm going to a Bon Iver concert tomorrow... Which coincides with boardgames day
 
@IDWMaster You can reinterpret_cast form a hat type to a compatible COM interface type. Marian Luparu's talk at //build/ 2012 has an example of doing this (channel9.msdn.com/Events/Build/2012/3-010), starting at about 43 minutes in.
@IDWMaster In both C++ and C++/CX, you can also use DataReader (msdn.microsoft.com/library/windows/apps/BR208119).
 
You cannot cast hats to hats directly?
 
You need to melt them first
 
@R.MartinhoFernandes You can cast among hat types, yes (using static/dynamic cast). But there is no IBufferByteAccess^, because IBufferByteAccess is not a WinRT interface (it's a COM interface). So you'd need to reinterpret_cast from IBuffer^ to the ABI IBuffer*, then QueryInterface to IBufferByteAccess.
 
I worked a little with COM in the past. It was kinda painful because I thought I could just start using it and figure it out as I go. Until a certain point that worked..
The I needed to implement IDispatch or something, and that was really confusing.
Reading the documentation probably would have save me lot's of time.
 
6:03 PM
@StackedCrooked that probably applies to lots of things :)
@CatPlusPlus by the way, kyrostat compiles with the new VC++ preview :) (well, without cosh's broken boost:variant)
 
reading documentation just brings pain and misery...
 
What's broken.
 
I was completely groggy for hours after reading up on win32 manifests the other day
 
Yeah, but that one was particularly hard. And since I was under quite some time pressure I kept trying to just quickly figure it out instead of taking the time to read good docs. However, good explanation of COM is only to be found in books.
 
@jalf Just like being alive.
I'm in a seriously shitty mood, find me something to rip apart.
 
6:06 PM
sasuga
 
-4
Q: Opinion on a program that reverse a string

ali8I have just finished making a program that reverse a given string. Right now the string must be of length 11 but this can easily be changed, what I want is your opinion. Note that I was an assembly programmer so that's why I am not used to "using the standard library", rather I am using to "brut...

 
@CatPlusPlus coshman has started on the platform thingy, and right now something is not quite working with the boost::variant usage
 
Probably because MSVC is shit
 
it doesn't work in gcc either :p
it's not a problem with variant itself, just how its used..I hope
 
Where's code.
 
6:08 PM
have you worked out what kind of game it is you're making yet?
 
@CatPlusPlus coshman's fork
 
Wasn't it RTS?
 
Christ, morons seeding files with no extensions.
Learn some intelligence, idiots.
 
I'm on a laptop with terrible keyboard in public tansport, I'm not gonna paste it now
 
So, for example, boolean doesShorterNameExistThatEquallyConvaysTheBehaviorOfTheMethod(String s) should be refactored to boolean isTooLong(String s). — z5h Feb 9 '10 at 17:08
3
 
6:10 PM
@melak47 That's very specific, thanks.
 
look at platform/window.h/.cpp,
also possibly util.h
 
@Mysticial lol that's awful
 
std::stack<std::weak_ptr<genericEventHandler>> what.
 
compiles fine but linker error says Kyro::Platform::Window::Create(variant stuff) undefnied reference
@CatPlusPlus uhhh eh, I dnno
 
@CatPlusPlus You mean BT extensions or filename extensions?
 
6:12 PM
Filename extensions.
 
What's wrong with it?
 
@melak47 Whatever happened to flat namespace hierarchies? ;)
 
I have to rename them.
 
@jalf ask cosh :p
 
6:14 PM
/r/gaming upvoted a picture of Gabe Newell to the front page twice. Holy fuck, why.
 
Because /r/gaming is terrible.
 
In thinking about move semantics, I realized that I don't know which C++ types allocate memory on the heap behind the scenes. std vector and string for one (well, short string optimization), but what about std::mutex or array or .. what else? Are all built in types always only on the stack?
 
But where will I get rich content such as this?
 
@melak47 What's the full error?
 
@JohanLundberg The simple answer is "depends on the implementation" ;)
 
6:17 PM
@JohanLundberg It doesn't matter.
 
@CatPlusPlus I have the stuff commented out the moment, I can paste it when I get home in a couple minutes
 
there's no rule against a mutex putting stuff on the heap, but I wouldn't normally expect it to happen
 
If you need to know implementation details, you're a scrub.
 
@JohanLundberg A std::mutex is not even movable.
 
Also, types can be movable without allocating anything on the heap. And objects which allocate data on the heap may not always be movable
 
6:19 PM
@CatPlusPlus I don't need to know, I just wanted to know if there's something in the standard. and where to read...
 
The standard only mandates the interface.
 
@JohanLundberg about which objects put stuff on the heap? The standard doesn't specify, because it's up to the implementation to make it as efficient as they can
 
Of course, in some cases, that doesn't leave many choices to the implementations.
 
@R.MartinhoFernandes and in some cases, it leaves the implementation to choose between "the sane way", and a couple of completely absurd, but technically legal, implementations.
Like std::string :)
 
@R.MartinhoFernandes Ok, good. So I think I should instead state it like this: is std::move required to be constant time for std::vector?
 
6:21 PM
@jalf Hell++ FTW
 
err. I mean. the move constructor
 
@JohanLundberg Yes. The standard requires that.
 
yes std string is a good example
I figured but I could not find it
 
@JohanLundberg The containers are described in section 23. Most common stuff is on table 96.
 
yes.. Hmm let me read again
 
6:24 PM
The complexity for the move constructor has a "(Note B)", which is explained after the table as "Those entries marked “(Note A)” or “(Note B)” have linear complexity for array and have constant complexity for all other standard containers."
 
thanks!
 
hmmm
if I wanted to put in a proposal, I'd have to give my full real name
 
you could always leave it anonymously on their doorstep or something. ;)
 
Mwahahahaha.
 
maybe next to a cookie and a glass of milk
 
6:29 PM
> Consider the extreme case of a string containing a digit 2 followed by 10,000 umlauts followed by one dot-below, then a digit 3. As part of normalization, the dot-below at the end must be reordered to immediately after the digit 2, which means that 10,003 characters need to be considered before the result can be output.
FFS.
creates test for this madness
 
huh
 
@R.MartinhoFernandes I tried now, for comparison to find if there's any such demand (constant time move) for basic string. I would have guessed linear could be allowed but again I have trouble navigating...
 
the forums on isocpp.org seem to be some kind of half forum, half mailing list
 
@JohanLundberg basic_string is a container, so it's covered.
 
6:33 PM
Ok, I will try again...
 
so now I can't edit
it's in HTML format, and the forum is for posting proposals which come in HTML format, so I was expecting that the HTML would, well, format.
but it doesn't
 
Hint: it is a mailing list.
It's just Google Groups web interface.
 
huh
 
@JohanLundberg it is one of those things where you'll just want to read the entire chapter of the standard, and then read it again. You can't just look up the section on std::string and assume that it tells you everything about strings. It depends on the earlier part of the chapter which describes common features of various kinds of containers, for example
 
@DeadMG You can post the stuff there in any format. Only when mailing to the committee do you have to use whatever is required (is it HTML?)
@jalf Containers come after strings.
 
6:36 PM
@R.MartinhoFernandes oh right
 
@R.MartinhoFernandes Sure, but I expected the HTML to render, rather than display literally.
 
Xeo
@LucDanton why not?
 
y'know what irks me more?
not only can you not edit, but you also can't preview.
who dafuq makes you send off stuff you can't preview or edit?
 
It's e-mail.
 
Nobody renders random HTML.
 
6:40 PM
@R.MartinhoFernandes If I ever wrote anything, ever, other than plain text in email I'd have the same complaint.
 
@Xeo Pack expansion sucks.
 
std::function argument?
 
@jalf The containers section does not talk about basic_string ...
 
template constructors are such a mess
it's simpler to just go with std::function argument
at least until the Committee figures out to use SFINAE to constrain them properly
 
Which one?
 
6:43 PM
@DeadMG You don't need to put that in the proposal.
 
I didn't
 
@DeadMG But you used a std::function argument.
You just do what the rest of the standard does: use a simple templated ctor and say that the constructor will only be picked when <conditions here>.
 
@DeadMG, did you get any further with the iostreams replacement idea?
 
that's not so simple from an implementation perspective
 
6:45 PM
@DeadMG Who cares? They have already been living with that.
 
HTML emails are terrible, and have fun formatting them.
 
sufficiently smart compilers ;)
 
That kind of thing is in several places of the current standard.
 
@R.MartinhoFernandes I don't mean the problem of using SFINAE.
 
My favorite dodge :D
 
6:45 PM
I mean the actual problems of having to use a template.
if you use std::function you can re-use the same binary code for each thunk.
if you directly forwarded to a function object, you'd have to have new binary code for each function object type.
 
I'm not sure what the discussion is about, but have you taken into account that std::function constructors that take functors are templates?
 
did occur to me
 
Random question, what is the latest ideas in C++ testing. Anything new or changed since 2 years ago?
 
@nixeagle visual studio has some c++ unit testing thingy. dunno if it's any good :p
 
void foo(std::function<Sig> f); does more than template<typename T> void foo(T t);, in case this is relevant.
 
6:48 PM
anyway, the distinction doesn't really matter
it's a trivial fix
 
Probably only works on microsoft windows though, even if it was good. :)
 
In any case, thunk can just store the thing in a function<...>.
 
if it needed changing
 
The only code that cannot be reused is the ctor.
 
@CatPlusPlus any idea how to remedy this? :)
 
6:51 PM
maybe I should propose string libraries and I/O libraries separately.
 
@R.MartinhoFernandes All right.. I found that basic_string::swap is constant time. Oh, well the constant time is allowed to be large, for example as large as required to copy the content of a small contained buffer (constant string optimization).
I think I learned something there..
 
Tension between optimizations.
 
@melak47 Show entire compilation log.
 
@DeadMG probably a good idea for several reasons. Easier to get smaller chunks adopted, and probably also leads to better, more modular, design. Part of the problem with iostreams is that it's this one big blob that tries to do so much, and doesn't interop well with anything else
 
Oh, nevermind, I know.
 
Xeo
6:57 PM
@LucDanton Thinking about it a bit, you don't need fancy pack expansion for that, you can just abuse overload resolution: liveworkspace.org/code/4c8d9041af14f806506d68f0818221a7
 
Don't put files in platform/.
 
@StackedCrooked Was that a reply to me? I guess copying that short buffer is fast
 
It's not for platform-independent files.
It's not a category of files.
Don't put files there, unless they're in one of subdirs.
Well, or change buildscript, I don't care.
window.cpp isn't even compiled.
 
lol. >_>
hmm...change build script...or put everything in a "stuff" folder...decisions, decisions...
 
6:59 PM
@JohanLundberg It should be fast but I recall seeing a blog post which proved that there can be significant overhead. Scott Meyers later mentioned it in his blog and expressed some worry, iirc.
 

« first day (749 days earlier)      last day (4191 days later) »