Ariana
klimi
my command will fuck up the saved then
Anonymous
But I need Marie to be up so that I can see the saved stuff
Dima
Marie Rose .. now I see what you did there
Marie
/save howtoask
Yas! Added howtoask. Get it with /get howtoask, or #howtoask
Anonymous
/saved
Marie
/saved
Notes in chat: - cpp - cppbook - freeprogrammingbooks - goodcodingmentality - goodgoogling - googleit - hownottoask - howtoask - ide - learn - meta - noendl - offtopic - ot - projects
klimi
#howtoask
Anonymous
It's slow af
Anonymous
I will just search them all in the chat and do it
klimi
y
Anonymous
y
We must switch to Rose now
Marie
#howtoask
Try phrasing your question like this: 1. Tell us the problem 2. Tell us what you have done so far. 3. Tell us how you got to this point 4. Paste code in pastebin or something similar 5. Wait for beautiful answers
klimi
k
Anonymous
/saved
Marie
/saved
Notes in chat: - cpp - cppbook - freeprogrammingbooks - goodcodingmentality - goodgoogling - googleit - hownottoask - howtoask - ide - learn - meta - noendl - offtopic - ot - projects
Anonymous
Hellow here
Onur
why this doesn't compile auto lambda = []() { std::cout << "hello "; return lambda; }; but this? ` auto lambda = [](auto dummy) { std::cout << "hello "; return lambda; };
BinaryByter
Give us your compiler message!
Onur
first one?
Onur
Compiler can't deduce the type
BinaryByter
Why do you return lambda btw?
Onur
Nothing important just trying to get javacript like func()()() syntax
BinaryByter
Compiler can't deduce the type
Try specifying the return type
BinaryByter
Nothing important just trying to get javacript like func()()() syntax
Lambda isnt available inside of the scope of the lambda, caputer it first!
Onur
this doesn't work either auto lambda = [lambda]() { std::cout << "hello "; return lambda; };
BinaryByter
show me the compiler warning please
Onur
hackerrank.cpp:4:17: warning: capture of variable 'lambda' with non-automatic storage duration auto lambda = [&lambda]() { ^~~~~~ hackerrank.cpp:4:6: note: 'auto lambda' declared here auto lambda = [&lambda]() { ^~~~~~ hackerrank.cpp: In lambda function: hackerrank.cpp:6:12: error: use of 'lambda' before deduction of 'auto' return lambda; ^~~~~~ hackerrank.cpp: In function 'int main(int, const char**)': hackerrank.cpp:11:11: error: void value not ignored as it ought to be lambda()()();
Onur
It can't deduce type but the silly thing is how it can deduce when I give it to a dummy parameter?
BinaryByter
Show me the whole code
Onur
auto lambda = [lambda]() { std::cout << "hello "; return lambda; }; main(int argc, char const *argv[]) { lambda()()(); }
BinaryByter
Dafaq why do you have three brackets?
BinaryByter
Remove two of em
Onur
auto lambda = [](auto) { std::cout << "hello "; return lambda; }; main(int argc, char const *argv[]) { lambda(0)(0)(0); }
Onur
this compiles btw
BinaryByter
Mhh
BinaryByter
Why do you do such fuckeries? 🤔
BinaryByter
XD
Onur
I was just trying something as I said nothing important but it is really interesting how it a dummy parameter make it be able to deduce the type
BinaryByter
Compiler type deduction can be weird
BinaryByter
Pretty sure olli knows more about it
Onur
Actually I don't think it is possible to write its return type, since it returns itself which makes infinite recursive type name
Onur
I like to try things like these when I am too tired to write actual code 😀
Bader
then sleep
BinaryByter
I like to try things like these when I am too tired to write actual code 😀
How about you stop trying to shoot yourself in the foot? :D
Anonymous
How about specifying the return value urself?
BinaryByter
He can't
BinaryByter
Since lambdas aren't a 'thing'
Anonymous
``` #include <functional> std::function< std::function<void()>() > ```
BinaryByter
We are talking about lambdas not snd functions
BinaryByter
Besides that wouldn't be what he wants to do
Anonymous
Language: cpp Source: #include <iostream> #include <functional> int main () { std::function<std::function<void()>()> lam = [&]() { std::cout << "lam()\n"; return lam; }; lam()(); } Result: lam() lam() Note: cplusplus_gcc assumed, other valid options are cplusplus_clang, visual_cplusplus, you can be more specific next time.
Anonymous
Aww C++
Anonymous
how to compile c++ in linux terminal
Anonymous
after saveing the file with .c extention
Naga Sai Manikanta
/saved
Marie
/saved
Notes in chat: - cpp - cppbook - freeprogrammingbooks - goodcodingmentality - goodgoogling - googleit - hownottoask - howtoask - ide - learn - meta - noendl - offtopic - ot - projects
Anonymous
/saved
Marie
/saved
Notes in chat: - cpp - cppbook - freeprogrammingbooks - goodcodingmentality - goodgoogling - googleit - hownottoask - howtoask - ide - learn - meta - noendl - offtopic - ot - projects
Vivek Pandey
Guys how to copy text from notepad to excel using concatenate symbol &
Vivek Pandey
I did by using double quotes( "") but it is upto 255 character only
Anonymous
#freeprogrammingbooks
Marie
#freeprogrammingbooks
https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md
Anonymous
#projects
Marie
#projects
1. Go to github.com 2. Tap on search. 3. Use advanced search. 4. Go to Advanced Search. 5. Select user's working language. 6. Press the search button. 7. Hover through the repositories and select one of them. 8. Fork it. 9. Do what you want to do. 10. Make a pull request so that the "original owner" can look at the changes and merge them if he feels the need to.
olli
why this doesn't compile auto lambda = []() { std::cout << "hello "; return lambda; }; but this? ` auto lambda = [](auto dummy) { std::cout << "hello "; return lambda; };
@linuxer4fun I canot reproduce this. Neither Clang, G++, nor MSVC compiles it. imho Clang has the best error diagnostic <source>:13:16: error: variable 'lambda' declared with deduced type 'auto' cannot appear in its own initializer See: https://godbolt.org/z/7B30bp
olli
Nothing important just trying to get javacript like func()()() syntax
using a functor such as the following Foo, you can call it and its return value. To do something like f(1)(2)(3)("Hello"); struct Foo { template <class T> const Foo& operator()(const T& t) const { std::cout << t << " "; return *this; } }; void bar() { Foo f; f(1)("Hi there")(3)(3.141f); }
BinaryByter
What's the definition of those suckers?
olli
What's the definition of those suckers?
Functors? The term is not defined by the standard but is used to describe function objects that can be "called" (defining operator () ) mem_func_t in Freebsd are function pointers (typedef for a function pointer returning int and taking several parameters)
BinaryByter
No mem_func_t in std::
olli
No mem_func_t in std::
std::mem_fn ? or std::mem_fun_t ? Although the exact return type of std::mem_fn is not specified it return a (stateful) function object std::mem_fun_t is a function object (has been deprecated in C++ 11 and finally removed in C++17)
BinaryByter
BinaryByter
ye,, those suckers