well to each his own... :-) i prefer minimum verbosity (like, I don't like Powershell). but not to the point of obfuscation. readibility most important. just as long as there is a model whereby the code translates easily into normal English.
e.g. i think assembly instruction hlt is silly. why not name it halt?
Thick as a Brick is the fifth studio album by the English progressive rock band Jethro Tull. Released in 1972, the album includes only one song: the 44-minute-long title track. Thick as a Brick was deliberately crafted in the style (and as a "bombastic" and "over the top" parody) of a concept album. The original packaging, designed like a newspaper, claims the album to be a musical adaptation of an epic poem by a (fictional) 8-year-old boy, though the lyrics were actually written by the band's frontman, Ian Anderson.
Album information
Thick as a Brick was Jethro Tull's first deep progr...
> Instances of std::reference_wrapper are objects (can be copied or stored in containers), but have reference semantics: calling a member function on a reference_wrapper invokes the member function of the underlying object.
@DeadMG i'll have to read the info on it , but so long as when the std::ref object goes out of scope, it's dtor called, that it does not try to get rid of what it referred to, then i might consider using it in code. I know that references are non owning , but my whole wrappings up in this questions has to do with a very specific corner case of using non owning pointers to parent class objects. @CatPlusPlus ty. thats what i was wondering
They say that inlining too much will make your code slower due to executable size. But at the same time there's stuff like link-time optimization that inlines everything. What's the deal here?
@CheersandhthAlf Well, I'm using the constructor of std::vector :p
@StackedCrooked I'm just glad that found an annoying bug ;)) After javascript using I could assumed that variables in C++ have own scope in for loops ;)
@StackedCrooked Inlining, like everything else, is a trade-off. Inline more = more redundant copies of the same instructions to be cached, decreasing your cache performance because the cache is effectively smaller. Inline less = too many function calls.
@Innuendo yes, but it was not always so. and some older compilers must be told to apply the new (standard) rules. in particular, for visual c++ there is the /Zc:forScope option to force conformance.
I've built a small, limited-scope, cross-platform UI library in C++. It uses the following classes to handle UI callbacks:
// Base class for templated __Callback class to allow for passing __Callback
// objects as parameters, storing in containers, etc. (as Callback*)
class Callback
{
public...
I got a call today. "Hi! This is Susan with Political Research Inc.! We understand that like many Americans during this controversial election season, you may be feeling frustration at the state of affairs. We're giving a 30 second survey and for completing it (you'll get) a 1-week cruise in the Bahamas for 2, courtesy of one of our contributors"
I mean, I can see that the whole point of the magic satellite was to make them come to the control panels, but the next bit didn't seem very well thought out
So that first 25 minutes of the episode aren't just a silly setup for Walter saying "oh gawd he's working from Bell" and then nobody believing him, because obviously his theories are never right.
Is there some function is STL, that finds the length of the max serie in a vector. For example bool vector: [1 0 1 1 1 0 0 0 0 1 ]. The length of max serie of value=1 : 3
I'm novice in C++, could you review this tiny function (finding max serie in vector)?
template<class T>
T max_serie( std::vector<T>& v, T x )
{
typename std::vector<T>::iterator it;
/// Current max value
int max= 1;
/// Cached max value
int _max = 1;
for(it = v.begin()+1; it != v.end(); ++it) {
max = ( *it == *(it-1) ) && ( *it = x ) ? max+1 : 1;
if ( max > _max) _max = max;
}
return _max;
}
?