« first day (752 days earlier)      last day (4195 days later) » 

8:00 PM
@R.MartinhoFernandes seriously
@sehe US law. you know.
@sehe "Electors chosen on Election Day meet in their respective state capitals (or in the case of Washington, D.C., within the District) on the Monday after the second Wednesday in December"
 
@MooingDuck Well, that's the same anywhere. People just love being important and demonstrating their profound thoughtfulness
 
Seriously, what is it with Apple asking for my mom's age to install XCode. It's not even that good
 
@MooingDuck That's just... Brillant!
 
@jalf Our government can call an election at any time. It just has to be any time sooner than five years after the last one.
 
@jalf We're small, so we have a single day for the whole deal. Always a Sunday. Sometimes there are boycotts in some places or someshit like that and the votes on those places are held the following week.
 
8:01 PM
@R.MartinhoFernandes I'm guessing they didn't want someone saying "Well, we're in a war, we can't have elections now!"
 
@kbok No need to tell us your mom might disappoint
 
@DeadMG yeah, same here (but within 4 years)
 
What ?
 
but since elections are usually deeply stepped in the traditions of the time when they first came about
 
@Collin Hehe. Because, well, it is only too simple to start a nice war. Or two. On the side
 
8:02 PM
I think it's not unusual for it to be relatively fixed.
 
Fuck, I have to enter a card number now ?
 
All just to get the pound/hash sign?
 
if you look at the list of elections, it's all over the place
 
@sehe it is Apple he's dealing with, after all
 
although in the last 40 years or so it's usually been spring, because that's when the local elections are and we save money by doing both at once.
 
8:03 PM
@DeadMG That can be a recent time depending on the place.
(Also depending on the meaning of 'recent' I suppose.)
 
@DeadMG ah, ours are just placed at tactically convenient times.. The government is doing good at the polls, and it's been around 3 years since the election? Probably a good time to call a new election then
 
user142019
@bamboon It is not yet available in The Netherlands.
 
Here it's the President that calls it.
The President's functions are: visiting places, calling elections, vetoing shit, and bringing down governments.
 
Here it's every 5 years but the assembly can do it earlier if they feel like.
 
@jalf You know, when you think about that, it actually makes sense to say that "one vote does not matter".
 
8:07 PM
@jalf Our governments are perfectly allowed to do that, but for some reason in the last few elections I haven't seen it.
 
@DeadMG They're never good at the polls?
 
@DeadMG of course, it can only be meaningfully done if you are actually doing reasonably well at the polls
 
There must be other things. Isn't the 'State of the Union' address a constitutional requirement?
 
@jalf A rarity for governments here.
 
@R.MartinhoFernandes And I think that was indeed MooingDuck's point earlier.
 
8:08 PM
@MartinJames vaguely
 
The US Constitution is vague?
 
@LucDanton it wasn't. I was sticking with: "It's important for a representative sample to vote. It's less important that I vote.
@MartinJames HAHAHAHA
 
I could almost hear that one laughter.
 
@MooingDuck Well you suck then.
 
I suppose it is a bit sorta 'incomplete' - you have the right to legal redress [if you can afford a lawyer].
 
8:10 PM
@MartinJames "The only inauguration element mandated by the United States Constitution is that the president make an oath or affirmation before that person can "enter on the Execution" of the office of the presidency."
 
..so the Oath of Inauguration is 'flexible'?
 
@MartinJames as long as he takes an oath before noon Jan 6th, he's president.
 
I finally got Jossuttis's "The C++ Standard Library" from the lib today, but I have to say I am a little bit disappointed.
 
Maybe I should actually read the thing one day, (just out of interest - not a US citizen).
 
@bamboon Why?
 
8:14 PM
@MartinJames I suspect most countries' equivalents are vague too
 
@MartinJames what thing? The inauguration? The constitution?
 
The Constitution of the United States.
 
@MartinJames it's vague, so as to be adaptable.
 
@R.MartinhoFernandes well, I expected more tutorial than reference. give cppreference another year and I would say they are on par.
 
@jalf Oh, here in the UK, we don't have anything written down.
 
8:16 PM
@MartinJames here ya go: archives.gov/exhibits/charters/constitution_transcript.html That's the origional "core"
 
Ell
The UK has a constitution, which I never knew until the other day
 
@MartinJames ah, we do, but it mostly talks about the king's religious affiliation and the royal line of succession and such
 
But I probably have to read a little bit more to make a final statement
 
also in a fun little piece of trivia, our king gave Norway a constitution before he let us have one :)
 
@jalf What did you do with it until then?
 
8:18 PM
@LucDanton with what?
 
> At this point, I'd like to take a moment to speak to you about the Adobe PSD format. PSD is not a good format. PSD is not even a bad format. Calling it such would be an insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having worked on this code for several weeks now, my hate for PSD has grown to a raging fire that burns with the fierce passion of a million suns. excerpt from a long code comment
2
 
@jalf The constitution.
 
@LucDanton what about it? We didn't have one. I guess the law was just whatever the king said
 
I don't think I understood what you said quite clearly then.
 
then he was convinced to sign one for Norway, granting them independence from Denmark (among other things), while it was business as usual in Denmark
 
8:21 PM
I just thought you had the text beforehand, but it took time to make it all official.
 
@LucDanton oh, nah
 
lol, that would be funny.
 
@jalf I got it now!
Not the same constitution obviously. Another one!
 
yep
 
When is result likely to be called?
 
8:24 PM
And apparently that is still the Constitution in effect for Norway? Makes as much sense as the Dutch anthem paying reverence to what's-his-face of Spain really.
 
robot
that other guy I'm talking to about Unicode also suggested that I swap my enumeration for a traits class
trying to decide exactly what members it needs
 
en.wikipedia.org/wiki/History_of_the_United_States_Constitution "At first, little interest was shown in the parchment object itself. Madison had custody of it as Secretary of State (1801-9) but having left Washington, he had lost track of it in the years leading to his death. A publisher had access to it in 1846 for a book on the Constitution. In 1883 historian J. Franklin Jameson found the parchment folded in a small tin box on the floor of a closet at the State, War and Navy Building."
 
@MartinJames too early
 
@LucDanton yep. I believe they've updated it somewhat since then (among other things, probably translated it to norwegian)
 
@DeadMG I think my final design was basically input iterator adapters and output iterator adapters and that was about it.
 
8:26 PM
Oh, according to Wikipedia, it's partially translated. According to their constitution, the official name for Norway is still in Danish :)
 
eh
 
Yeah, that's definitively mad!
 
I'm not such a big fan of iterator adaptors
 
basically a matter of swapping a g out for a k, but still
 
I'd rather just see plain functions.
 
8:26 PM
@jalf lol
 
@DeadMG you're not a big fan, period?
 
Ask him about SS2.
 
Oh.
@DeadMG Well, I'd say: encode, decode, validating and non-validating variants (people will want them). Then relevant typedefs.
 
@R.MartinhoFernandes Also recommended was iterator adapters, to view encoding as UTF-32 and view UTF-32 as encoding.
 
@DeadMG That wording confused me.
Oh, you mean stuff like decoding_iterator<utf8, some_iterator> and encoding_iterator<utf8, some_iterator>?
 
8:30 PM
@R.MartinhoFernandes I had utf8::encoding_iterator<some_iterator>
 
yeah
 
oh, this is great, "Since amendments are elaborated by politicians not competent in 19th-century Danish, several modern Norwegian spellings have sneaked into the constitution"
 
Ah. Because UTF-32 is an encoding, so that was not making much sense.
 
I guess it's written in broken Danish then :D
best constitution ever
 
I should look at where I gave up on my unicode string stuff
 
8:32 PM
@DeadMG I don't see why not.
 
hmmmm
I'm not too happy with it
too many iterators and adaptors and not enough functions.
 
@jalf Also there are two written forms for the Norwegian language. Hopefully both are in it.
 
I went through like, five different designs for it until I got reasonably happy with it, though.
 
and the names are terrible, so for most of them I only have half an idea what I'm even talking about.
 
Hello.
 
8:33 PM
@DeadMG You could define functions in terms of the iterators or vice-versa.
If you don't, people will anyway.
@DeadMG lol
 
@Xeo I needed to tell you, but look at what I did! Ranges are a WIP.
 
oh of course my unicode string project is named "UTF8". No wonder I couldn't find it.
 
Ell
if anyone is feeling generous, could they have a quick read through this 3 para. article to check for errors? pastebin.com/wa2VGD4L
 
oh right, I gave up because I got bizzare compiler errors that make no sense
 
Sep 1 at 16:27, by R. Martinho Fernandes
I think I had my dosage of fun while I was chewing down on those 18k errors the other day.
Perserverance!
 
8:38 PM
@Ell Unnecessary semicolon.
 
@R.MartinhoFernandes c:\program files\microsoft visual studio 10.0\vc\include\xutility(373): error C2146: syntax error : missing ';'
 
BMI isn't a ratio, it's a formula.
 
You got the parser confused somewhere. My advice is to ignore whatever the compiler says and look for the error yourself.
 
@R.MartinhoFernandes I did. For days
 
8:40 PM
I usually start counting angle brackets in these situations. It's sad.
 
I usually start by commenting out huge chunks until the number of errors drops substantially.
 
Ell
@Rapptz where? and BMI is a ratio?
 
you know
this concerns me.
 
Line #3.
 
how problematic is it to write something that can view UTF-32 codepoints as UTF-8 code units?
I mean, each codepoint could decode to >1 code unit.
 
8:43 PM
You mean on the implementer's side?
 
As for BMI in America, it's not a ratio.
 
yep
 
@Ell As my physics teachers would have said, it's a quotient.
 
IME, it's annoying as fuck.
Perfectly feasible though.
 
hmm
I don't have a problem with "annoying", only "Impossibru!".
 
8:44 PM
Oh, it's possible.
Please don't use "UTF-32 codepoints" in the proposal.
It's weird.
 
Also if you want to be more specific, you could say the condition you're talking about is Hypovolemic hyponatremia, which is when your body water level increase yet sodium is lost.
 
Xeo
Didn't the robot solve that with vectors in his iterators or something?
 
@Xeo Nah, those ones have fixed size buffers.
 
Xeo
mhm
 
It's decomposition that gets terribly fucked up.
The ape gave me a nice idea the other day, though.
 
Ell
8:47 PM
@Rapptz I guess. It's meant to be simple though, don't want to confuse simple folk with big words
 
partial_array is like a vector backed by a fixed-size array.
 
@Xeo Interested in an indices riddle? I use *std::next(boost::begin(range), mod(Indices, distance))... when slicing forward traversal ranges (or better). What about single-pass ranges? Assuming monotonically increasing indices and auto it = boost::begin(range);, then I could use something like *std::advance(it, /* magic */)....
 
Xeo
@R.MartinhoFernandes So, SBO?
 
@Xeo No, it never grows beyond those bounds.
Given an encoding I know the maximum size of any codepoint.
 
Xeo
I don't quite see the point. If you know the maximum size, just reserve only that?
 
8:51 PM
Well, if there are encodings out there where that is not true, I don't support them.
@Xeo Why reserve if it's known at compile-time?
It's just an array with a size_t.
 
Xeo
Now I don't see why you don't use std::array for that.
 
@Xeo I do, it's in the innards of partial_array.
@Xeo It's nothing special really bitbucket.org/martinhofernandes/ogonek/src/…
 
Xeo
Ah, I see.
You just want to know how many elements are actually filled in that array.
 
Yeah.
@DeadMG Looks fine.
 
8:56 PM
the names are a lot better
 
Xeo
@LucDanton If you pass that as arguments to a constructor, you'll get evaluation order problems, won't you?
 
I'm braced for impact.
 
lol
Good one.
 
Xeo
hrhr
 
gee gee
 
Xeo
8:57 PM
I just can't seem to remember that list-initialization guarantees left-to-right evaluation.
 
Up to now make_slice was written with make_tuple though, will have to change in this case.
 
Ell
pinvoke is really cool imho
 
ice is cool
@R.MartinhoFernandes the thing that continues to surprise me is this: you count the error lines? why?
 
Validating by throwing is a bit limiting, but it gets really messy if you try to make that a customization point.
@sehe Vim does it for me.
 
Oh man, I never noticed that. Do I have to enable it?
 
9:02 PM
@R.MartinhoFernandes I still don't even take the effort to scroll /jump to the end
@LucDanton se nu, likely setgl nu
 
Ell
@R.MartinhoFernandes validating by throwing?
 
@Ell Well, throwing if invalid.
 
;)
 
@sehe Erm, it says "(n of m): blah".
 
Ell
you can ignore it though as well?
 
9:04 PM
@R.MartinhoFernandes I would find out. But I fried my PC last night and I'm not in the mood to set things up for today. Busy. Never seen the counts.
 
@sehe Well sure but when it comes to huge compiler output I usually (and frantically) go ^C^C^Cqqqqqqq, as you apparently do.
 
Or should I say, my PSU organized an illegal barbecue
2
 
@Ell In my lib I have default policies for throwing, for dropping invalid data, for replacing it with U+FFFE REPLACEMENT CHARACTER, and for not validating at all (in case it's already validated).
 
@LucDanton Nah. I just switch to console vim + screen. Switching away makes terminal IO very fast :)
 
9:05 PM
You can write your own policy, but let's just say that is not a pleasant part of the design.
 
Ell
yeah thats it. I couldn't remember the other two, but I read your docs
@LucDanton ^Z stops it straight away doesn't it?
 
@LucDanton also, qqqqqqq would mean? (qq record @q, q end recording; repeat 1x; q... pending)
 
@Ell Backgrounds. Suspends. SIG_STOP
 
@sehe When it asks me to scroll through the whole output (yeah right).
 
Ell
9:07 PM
oh. Does that mean I have a load o background stuff ? :L
 
@EtiennedeMartel I'm trying to figure out the geometry of that bike. That is some odd bike.
 
@EtiennedeMartel Well, that domain name prepared me a little but still.
 
@Ell ps -ef, ps -aux, pgrep -fl gcc etc
 
Oh, dammit, U+FFFE is the BOM. The replacement character is U+FFFD. I know PILE OF POO by heart, but not the replacement character.
 
9:10 PM
@LucDanton Facho Watch is an organization that tracks fascism in Quebec. Their website has some incredibly depressing news.
 
@R.MartinhoFernandes What does it look like? It doesn't show on my computer.
 
Ell
@R.MartinhoFernandes Where does the BOM go? For some reason in my mind, all the text is reversed in little endian to big endian. Funny really :L
 
@LucDanton U+FFFD? It's often rendered as a black lozenge with a white question mark. I'm sure you've seen that before.
 
Oh well. I'm sorry you went through the trouble.
 
@DeadMG I think I coded it so that *it on the wrapper will call *it; on the wrapee multiple times. It became relatively trivial. wait, that would run into issues with the end iterator. I don't recall how I handled that.
 
Ell
9:12 PM
mmm lozenges
 
@MooingDuck By keeping the end iterator as well?
 
@R.MartinhoFernandes oh right, I was gonna convert everything to ranges
 
@Ell Nowhere. It's just a signature. In text it's a zero-width no-break space, which makes it pretty much invisible.
 
That usage as a ZWNBSP is deprecated though.
 
9:15 PM
Zuwinbusp.
 
@Ell usually BOM is the opening codepoint
 
@MooingDuck What.
 
@MooingDuck Hmm, I always considered that Facebook-class Attention Whorism, Food Showoff variant.
 
@EtiennedeMartel interesting, I just got that pic from a facebook page
 
9:21 PM
I was talking about Alf's behavior regarding food pictures.
Like, "look at how awesome I am for eating that delicious food".
 
What? He doesn't exclusively post pictures of what he eats, does he?
Also it's a picture of the same dish, not the one he prepared / was served.
 
@EtiennedeMartel Thing is, it usually looks utterly repelling. "That delicious food"? Never once crossed my mind
@LucDanton I got the inverse impression. I remember commenting as to the shabby presentation and furniture style once
 
@sehe Aren't the images from wildly different domains?
 
posted on November 06, 2012 by Herb Sutter

My live Q&A after Friday’s The Future of C++ talk is now online on Channel 9. The topics revolved around… … recent progress and near-future directions for C++, both at Microsoft and across the industry, and talks about some announcements related to C++11 support in VC++ 2012 and the formation of the Standard C++ Foundation. [...]

 
nice
 
9:26 PM
@LucDanton well, apparently not all of them. Others do post food pics too, though. Often in response. It is as with youtube links: it triggers an exchange
 
sbi
Good evening.
@R.MartinhoFernandes Indeed.
@R.MartinhoFernandes Better late than never. And what do you think? Wanna read the rest of 'em?
 
sbi
@R.MartinhoFernandes Well, I have them all. I could bring one on Thursday, if you want.
@MooingDuck Erm, what? Can you elaborate?
@R.MartinhoFernandes I am giving you ideas? Uh oh. What's it?
 
@sbi Nevermind that. As a proposal, it was a total failure.
 
sbi
@R.MartinhoFernandes Interestingly, it never showed up in my inbox. I only found it by accident.
 
9:29 PM
@sbi Ok. And I can return you this one I have.
 
sbi
@R.MartinhoFernandes "...does not not work", huh? I'll have to contemplate over this one for a while.
 
@sbi maybe there is a limit to offline notifications per message... eek (Balpha?)
 
@sbi people keep coming in here with C++ SO questions. I wondered what regulars thought about removing the C++ from the name to keep the room's intent clear. Ideas was shot down.
Everyone had different reasons, but it was unanimous among people who responded.
 
sbi
@MooingDuck Why do you think it's bad when people come here to ask C++ questions?
 
@sbi instead of joining a conversation, they're interrupting to get focus on themselves. I find it rude.
 
sbi
9:35 PM
@MooingDuck And if the "C++" would be lacking, you think they'd be less rude?
 
@sbi I think it would deter a small number, and we'd have fewer protests when we say we won't answer their questions.
 
sbi
@MooingDuck Oh, there was protest?
 
@sbi they always protest
 
@MooingDuck Except from that guy who's message got binned by @Mysticial, or did I miss it?
 
@Borgleader alright, not always. But usually.
 
9:38 PM
That I can agree with.
 
@MooingDuck Oh, forgot that you pinged me for that. I don't have a strong feeling one way or the other, but if flags from other rooms are an indication changing the name may not help at all. It may be the case that people come ask things here because we're very active.
 
@Borgleader there's been a few
 
sbi
@MooingDuck I think that this is a social problem, and there's no policy, technical measure, or psychological trick in the world for stopping those people from being rude.
 
@LucDanton That is the case as mentioned by many who post here. But it would deter some and be clearer to those we say no to.
 
@LucDanton Given the number of times the excuse is "the X room is dead"...
 
9:39 PM
WHAT?! it's fucking C++ room
2
 
What is fucking it?
 
@sbi well sure, but it's hard to explain why we won't answer their C++ questions in the C++ room of the stack overflow question site.
 
and it's all about C++
 
@MooingDuck Because .
 
@R.MartinhoFernandes I think he accidently a word
 
9:40 PM
@Borgleader I know. I like to prey on that.
 
AHhhh I see
 
sbi
@MooingDuck It's the Lounge, over there's the newbie hints, and there used to be a room for answering C++ questions. Now where have I mislaid the link....
 
Don't look at me.
 
If we remove the C++ from the title don't we run the risk of getting trolls from the PHP room in here?
 
It's called a lounge. If I sit in the lounge at work to drink my coffee, I don't expect to be forced to talk about work. I will do, if it's interesting or useful, but I usually prefer to leave such stuff to when I'm at my desk.
 
9:41 PM
also we can't bully noobs if it will be a regular lounge room
 
@sbi I'm aware, but they only see the C++ half
 
sbi
@MooingDuck Yes, and if you remove that, we'll get even more people asking Java questions. Really, it's a social problem, not a technical one. We will have to deal with it no matter what we do to prevent it.
 
@MooingDuck except for the ones who come here to ask PHP questions, or SQL questions or... :)
 
sbi
@R.MartinhoFernandes I didn't. I was being sarcastic: I know that room died long ago.
 
@R.MartinhoFernandes Remind me again, what was your plan for dealing with text files whose encoding is not known until run-time when they're traits and not an enumeration?
 
9:44 PM
@DeadMG There's two options: either you do know the encoding from metadata or from the user picking from a dropdown or whatever; or you don't and you need to detect it. Either way you can do it fine with some simple type erasure.
 
@jalf they don't see any half
 
so I'd just be like template<typename Encoding> constructor(..., Encoding e)?
 
@jalf Those people are just retards. They probably came here because it was the first chat in the list.
 
@DeadMG yeah
@sbi and clear communication is a social (partial) solution
 
@DeadMG That would work. An user can always do it with an enum since the set of supported encodings is set at compile-time.
In any case, I haven't thought much about detection.
 
9:47 PM
@sbi I never made any claim that renaming would make a significant decrease in link dumpers. I just said a tiny decrease, along with easing explanations as to why we won't answer.
 
We could just make a bot that does the explanation for us
 
@R.MartinhoFernandes give each type a float guess_is_encoding(iterator, iterator), returns "probability" 0-1?
 
@R.MartinhoFernandes Me neither. I think it's OK to ask for an encoding.
 
I don't like what I just proposed, that's stupid.
 
@MooingDuck lol
 
9:49 PM
Detection algorithm along the lines of "please/help/answer question" bundled with an SO link gets an instant:
 
Who would think of such a thing
 
@MooingDuck The thing is, sometimes the encoding comes as metadata in the document itself.
And that depends on the kind of document.
 
@MooingDuck This is still the room where people enjoy talking about C++, template wankery, etc. I think the name couldn't be more fit :)
4
 
@R.MartinhoFernandes Like HTML?
 
@R.MartinhoFernandes so?
@kbok and Haskell
 
9:50 PM
The more I think about it, the more I think it belongs in application code.
 
sbi
@MooingDuck Yeah. Let's do this every time someone comes in here.
@MooingDuck Really, I find your proposal interesting. This here is much more than a C++ room. People hang out here for the company, and we're well known to discuss anything. Maybe we shouldn't prematurely exclude non-C++ programmers? Maybe the room's name should reflect that? And maybe not. I dunno. However, I am very sure that the problem you are annoyed by won't be solved by removing "C++" from the room's name. It might not even get better. In fact, it might get worse.
 
@MooingDuck So, you would have to write those functions with knowledge of HTML and XML, for example.
@Borgleader Yeah.
 
sbi
@MooingDuck Nope. We do not enjoy talking about Haskell. That's what the Haskell room is for, after all.
 
@MooingDuck sure :) And PHP. We talk a lot about PHP after all.
 
Haskell is useless
 
9:51 PM
@MooingDuck We barely talk about Haskell here. It's mostly the cat or daknok saying it's awesome, and someone else saying it sucks. It very rarely goes beyond that.
 
I never said such a thing.
 
@Abyx this kind of thing.
 
@R.MartinhoFernandes nonsense, for things like html, it would have to be application code. I thought you meant when you have text and literally no idea what the encoding is.
 
@MooingDuck What's a "text file"?
 
whoa, not a new idea:
Oct 30 at 23:04, by Pubby
I wonder what would happen if we remove the <C++> from Lounge<C++>
 
9:53 PM
@MooingDuck Type erasure.
 
what's the name for std::hex and whatnot?
 
I/O manipulators.
 
yeah
 
@DeadMG manipulator
 
It's never good. Look at what it did for Java.
 
9:54 PM
@kbok lol
 
just writing a little bitch about how the string stuff is far too coupled to the I/O stuff
 
@MooingDuck A rift in the Stack Overflow Chat Nature, resulting in a Vacuum. And nature abhorrs vacuums.
 
sbi
Well, here's a puzzle for you: I have to hand around buffers. I push them back onto STL containers, and pop them out the front. I don't want to actually copy the data, so I carry a pointer (char*) and the length (std::size_t) rather than, say, a std::vector<char>. The buffers should always only be accessible from one place, so ideally I'd move them around, rather than copying them, but, alas, this is C++03.
Also, while I thought there's std::tr1::unique_ptr, there isn't in this implementation. I am afraid shared_ptr's counter locking might be a performance hog. (I am desperately fighting lock contention.) Incorporating boost is on the list, but I can't do this single-handedly before I finish this.
So I need to create a smart pointer for this kind of buffer. Ideally, this would be a moving smart pointer. However, C++03's STL doesn't do moves. And you mustn't put auto_ptr into containers. I don't really share those buffers, so a shared pointer would be useless. Now, What do I do?
 
How can you post so fast, do you have something to bypass the post cooldown ?
 
9:55 PM
@sbi why not vector<char>::swap()? Sometimes it's tricky, but I've usually found a way
 
@sbi unique_ptr needs language support (or hackish stuff like in Boost.Move), so it was not in TR1.
 
sbi
@kbok Grumpy old apes aren't affected by that.
@MooingDuck "I push them back onto STL containers, and pop them out the front." Pre-C++11, this will copy, rather than swap.
 
@sbi not if it's a deque
 
@sbi You can do move semantics emulation in C++03 AFAIK
 
@sbi should it be thread-safe?
 
9:56 PM
@sbi You will have to create a unique pointer that is always explicitly moved. Similar to auto_ptr, but explicit. In addition, you will have to roll or specialize your own containers to cope with this.
 
sbi
@Abyx The container is. The buffers are always only accessed by one thread.
 
the reason rvalue references are a core language feature is that there is no real solution to this in C++03 except shittons of effort.
 
@sbi If you write your own specialized container it can work.
 
sbi
@MooingDuck Yes, even then.
 
Oh yeah, hackish.
 
9:57 PM
now
 
sbi
@kbok That's a bit vague, I think.
 
@sbi so, why don't you write a non-threadsafe ref-counted pointer?
 
@R.MartinhoFernandes I second that. It's either that or wait for Boost.Containers (not that I've used it and can recommend it -- but it's supposed to do that).
 
MSVC does have "swaptimization", and in theory, you could roll your own containers using this as the basis for not requiring copyability- where the existing containers copy, you swap, and require lvalues.
 
@sbi Like @R.MartinhoFernandes said, boost.move
 
9:57 PM
@sbi to enter data: push_back, swap in the data. to remove data: swap data, pop_front. There's no way to make that work? (sometimes there isn't)
 
but it would get messy quickly
 
also, maybe there is one in llvm::adt
 
@kbok I don't think that works in containers: containers are not aware of the hackery that needs to be done (i.e., they just copy)
 
sbi
@DeadMG I will absolutely not write a container doing move semantics in C++03. This is a side-problem. I need to solve it ASAP, or the code will be stuck with the explicit delete[] it is littered now.
 
@R.MartinhoFernandes Ah, crap.
 
sbi
9:59 PM
@MooingDuck There is: I would need to write my own container. I don't want that.
 
@sbi what I wrote should work fine with std::deque under certain limitations and std::list always.
 

« first day (752 days earlier)      last day (4195 days later) »