In C and C++, the comma operator is a binary operator that:
- Evaluates the first operand, and discards the result
- Evalutes the second operand, and returns this value
So:
if (a,b) {
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
func ExpectJSON [T any] (b []byte) (T, error) { | |
var ( | |
err error |
// Online Go compiler to run Golang program online | |
// Print "Try programiz.pro" message | |
package main | |
import "fmt" | |
// --- | |
type Restful interface { | |
Get() string |
package main | |
import "fmt" | |
type R interface { | |
A() string | |
B() string | |
} | |
type C interface { | |
R | |
Method(string) func(C)string |
#include <chrono> | |
#include <cstdlib> | |
#include <iostream> | |
#include <ratio> | |
#include <string> | |
#include <thread> | |
#include <vector> | |
#include <mutex> | |
// [ Written to C++11 standard ] |
// Note: Use mutexes people | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// generic type: response | |
type re [T comparable, U any] struct { |
package main | |
import "fmt" | |
import "encoding/json" | |
import "bytes" | |
type AuthPost [T any] struct { | |
UserID string `json:"userid"` | |
SID string `json:"sid"` | |
Data T `json:"data"` | |
} |
package main | |
// Continue here: https://go.dev/blog/pipelines | |
import ( | |
"crypto/md5" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
"sort" | |
"sync" |
package main | |
import "fmt" | |
// Take a variadic list of integers, and launch a goroutine which will block trying to send them on channel 'out' | |
// Return this channel as a receive-only channel | |
func gen(ns ...int) <-chan int { | |
out := make(chan int) // Create a bidirectional channel | |
go func() { | |
for _, n := range ns { |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
class Sensor | |
{ | |
public: | |
enum Type | |
{ | |
ALTIMITER = 0, |