Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The C++

Name: Anonymous 2010-11-10 12:42

ENTERPRISE C++ uses templates and ambigious function names for EVERYTHING.


#include <iostream>
#include <vector>
#include <cstdio>

template<typename s_t> void _sv(s_t&_s,const s_t&_i){_s=static_cast<s_t>(_i);}
template<typename t_1> bool _isl(t_1&_1,t_1&_2){return(_1<_2);}
template<typename t_1>bool _ise(t_1&_1,const t_1&_2){return(_1==_2);}
template<typename t_1>void _ic(t_1&s,const t_1&v){(s=s+v);}
template<typename a_t>class c_1:public std::vector<a_t>{};
template<typename a_t, typename b_t> class _a{
    a_t a;
    a_t _1_i;
    b_t b;
    char* _c;
    c_1<std::string> _rs;
    public:
        _a(a_t _a, b_t _b): a(_a), b(_b)
        {
            int _h_i;
            _1_i=0;
            if(_ise(a,1)) goto _L0;
            for(_sv(_h_i,1);_isl(_h_i,a);_ic(_h_i,1))
            {
                _c=b[_h_i];
                _rs.push_back(_c);
            }
            _1_n(); return;
            _L0: printf("go cry in a corner\n");
        }
        void _1_n()
        {
            std::string _1_s;
            typename c_1<std::string>::iterator _hi;
            _hi=_rs.begin();
            _L1: if(_hi==_rs.end())return;
            _1_s=*_hi;
            printf("argv[%d] = %s\n", _1_i, _1_s.c_str());
            _hi++; _1_i++; goto _L1;
        }
};

int main(int a, char** b)
{
    _a<int,char**>(a,b);
}

Name: Anonymous 2010-11-10 12:46

Also, for the Java douchebags who fail at reading ENTERPRISE C++, it prints commandline arguments.

Because I suppose /prog/ uses THE LUNIX.

Name: Anonymous 2010-11-10 12:51

>>2

I use Plan 9.

Name: Anonymous 2010-11-10 12:57

>>2
Because I suppose /prog/ uses GNU/linux.

Fixed. And you should too. Idiot GUI using monkeys can go to Reddit.

Name: Anonymous 2010-11-10 13:13

>>1
Looks like FrozenVoid started doing Sepples.

Name: Anonymous 2010-11-10 13:36

>>4
Idiot GUI using monkeys

You mean, those who aren't blind, and enjoy getting shit done?

Name: Anonymous 2010-11-10 13:38

>>6
This is what GUI using monkeys actually believe.

Name: Anonymous 2010-11-10 13:46

>>6
The only shit that get's done with you is the shit your mother took on your face.

Name: Anonymous 2010-11-10 14:18

>>1
template<typename s_t> void _sv(s_t&_s,const s_t&_i){_s=static_cast<s_t>(_i);}

isn't the static_cast redundant? _i is already an s_t because of const s_t&_i

Name: Anonymous 2010-11-10 14:23

>>1
write an entry level C++ code to print command line arguments
refactor everything to be a template
obfuscate all names
mfw you think you're a genius

Name: Anonymous 2010-11-10 14:26

>>10
your mum must be so proud of you

Name: Anonymous 2010-11-10 14:32

Name: Anonymous 2010-11-10 14:47

what what in the butt

Name: Anonymous 2010-11-10 14:53

>>9
templates for everything.

Name: Anonymous 2010-11-10 15:26

>>1
Enterprise? You've got it backwards: enterprise has identifier names no shorter than 15 characters. What you have there is the proper Open Source style.

Name: Anonymous 2010-11-10 16:51

>>15
It's Enterprise style with Open Source style naming convention.

Name: Anonymous 2010-11-10 17:42

Enterprise Open Source

Name: Anonymous 2010-11-10 21:00

>>9
It probably isn't completely superfluous.


i is a const reference to a s_t. The static_cast doesn't (and can't) mess with the constness, but I believe it casts away the reference so it may be assigned to the other reference without reference aliasing (a term I just made up based on pointer aliasing). Of course, it could also be completely superfluous, I'm not going to bother putting the code into a compiler to see.

Name: Anonymous 2010-11-11 0:02

>> 1
goto

Just look at youtself. This is not ENTERPRISE C++. This is simple shit. Remove goto to get ENTERPRISE quality shit

>>10
mfw

I'm sorry to inform you, but you need to get back to imageboards now, ``jew''. You're not welcomed here anymore.

Name: Anonymous 2010-11-11 6:13

>>19
ENTERPRISE C++ doesn't need no foolish for() or while() constructs.

prease2lernenterprise sir

Name: Anonymous 2010-11-11 6:42

>>20
Learn 2 sage, ``liberal''

Also don't confuse ENTERPRISE C++ and ENTERPRISE VB6. VB6 is too good to be confused with C++.

Name: Anonymous 2010-11-11 7:11

>>21
oh yeah? bump

Name: Anonymous 2010-11-11 8:55

>>21
VB6

Name: Anonymous 2010-11-11 16:27

>mfw NO FUCKING CODE COMMENTS

Name: Anonymous 2010-11-11 16:35

>>21

>VB
>good

MAXIMUM TROLLING

Name: Anonymous 2010-11-11 16:45

>>24,25
>mfw
>VB
>good
MAXIMUM TROLLING


Go back to /b/

Name: Anonymous 2010-11-11 16:47

>>26
QUOTING FAILURE DETECTED

Name: Anonymous 2010-11-11 16:51

>>21
VB
good


( ≖‿≖)

Name: Anonymous 2010-11-11 16:53

>>27
I separated two different quotes. And I have bitch tits.

Name: Anonymous 2010-11-12 21:02

C++ makes RAII possible. C makes RAII impossible. C++ strikes again!

Name: 2010-11-12 21:10

>>30
myobj_destroy(struct myobj *this);

Name: Anonymous 2010-11-12 21:48

>>31
prease2learnRAII, ``Nameless Faggot''

Name: Anonymous 2010-11-12 21:48

>>31 simple function does not help.You still need to call it manually. Have a nice day in function with several returns.

Name: Anonymous 2010-11-12 21:57

>>33
>>32
ya'll just mad because you don't have the logic and thinking process required by See.

Name: Anonymous 2010-11-12 21:59

>>31
In C++, the destructor is called as soon as the object goes out of scope.

In C, the destructor is never called as soon as the object goes out of scope, because
   1: C doesn't have a scope in the same meaning as in C++;
   2: Structs in C don't have destructors, which makes scopes already void and useless;
   3: you have to call myobj_destroy manually, which also makes 1 and 2 void and useless.

For example:

#include <cstdio>

class File {
    private:
        FILE* handle;

    public:
        File(const char* path)
        {
            handle = fopen(path, "w");
        }

        ~File()
        {
            close();
        }

        void close()
        {
            fclose(handle);
        }

        void write(const char* data)
        {
            fputs(data, handle);
        }
};

int main()
{
    File poop("things.txt");
    poop.write("hi");
    // no need to call 'poop.close()', as close() is called as soon as
    // poop goes out of scope
}


And now in C:
there is no C example, since C makes RAII impossible. it would be just the same with FILE* fopen(const char*, const char*) and void fclose(FILE*), without actually being able to call fclose upon destruction, as there is no such thing as ``destruction'', as in C++.

Name: Anonymous 2010-11-12 22:01

god forbid you to write one extra line to destroy a struct

Name: Anonymous 2010-11-12 23:08

>>36
Now that makes sense.

And by the way, my dear >>35:
1. A scope is a scope, the context where some variable live. C have one.
2. C structs are POD, you can't have methods in a struct, is not a fucking nerfed class like in C++, this doesn't mean that scope is ``void and useless''.
3. Because your little poor fingers hurts when you have to type just one little fucking function at the end of the scope.

You have a strange concept of scope, look at this code:

{ /* begin of the scope */
  int i; /* C automatically allocates i on the stack */
  struct astruct *s; /* C automatically allocates a pointer to ``astruct'' on the stack */
  struct anotherstruct s2;
  astruct_init(s); /* We manually call the constructor */
  anotherstruct_init(&s2);
  /* do some stuff */
  anotherstruct_destroy(&s2);
  astruct_destroy(s); /* OH MY GOD WE ARE CALLING THE DESTRUCTOR MANUALLY PLEASE KILL ME I'VE DISONORED MY FAMILY I WANT TO DIE */
} /* end of the scope, C automatically destroys i, s (the pointer) and the struct s2. */


Sure, it doesn't mean you can do RAII in C, but "C can't do RAII" and "C doesn't have a scope" are two different things.

If you can't remember what you have to deallocate at the end of a scope, go back to your C++.

You're now destroying your structures manually

Name: Anonymous 2010-11-12 23:12

>>37
Sure, it doesn't mean you can do RAII in C

I'm glad you're finally admitting it.

Name: Anonymous 2010-11-12 23:20

>>38
Yeah.
poster_destroy(>>38);
}

Name: Anonymous 2010-11-13 6:37

An important point is being glossed over. C++ destructors can be called automatically when an exception is thrown. You can turn several calls to free() within pseudo exception blocks into automatic destruction when exceptions are thrown.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List